Sha256: 6cfdc31e2ced6dcc9cef40b0d4ff40ce7d10f7c8513a7c4e67c0f168d9441fde

Contents?: true

Size: 476 Bytes

Versions: 2

Compression:

Stored size: 476 Bytes

Contents

module Oauth2
  class UsersController < ApplicationController
    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
end

Version data entries

2 entries across 2 versions & 1 rubygems

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