Sha256: 065ca89922868beb6ea562e95114fc007248d2314f802cd3caa6024c26eb9683

Contents?: true

Size: 433 Bytes

Versions: 1

Compression:

Stored size: 433 Bytes

Contents

class Oauth2::UsersController < Oauth2Controller
  before_filter :ensure_token!
  before_filter :find_user

  def show
    render :json => @user.attributes.only(*%w[name email uuid])
  end

  protected

  def find_user
    @user = find_user_by_uuid(@access_token.user_id) or render(:nothing => true, :status => :bad_request)
  end

  def ensure_token!
    @access_token = Oauth2Token.find!(:token => params[:access_token])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vidibus-oauth2_server-0.0.3 app/controllers/oauth2/users_controller.rb