app/controllers/oauth2/users_controller.rb in vidibus-oauth2_server-0.0.2 vs app/controllers/oauth2/users_controller.rb in vidibus-oauth2_server-0.0.3
- old
+ new
@@ -1,20 +1,18 @@
-module Oauth2
- class UsersController < ApplicationController
- before_filter :ensure_token!
- before_filter :find_user
+class Oauth2::UsersController < Oauth2Controller
+ before_filter :ensure_token!
+ before_filter :find_user
- def show
- render :json => @user.attributes.only(*%w[name email uuid])
- end
+ def show
+ render :json => @user.attributes.only(*%w[name email uuid])
+ end
- protected
+ protected
- def find_user
- @user = find_user_by_uuid(@access_token.user_id) or render(:nothing => true, :status => :bad_request)
- end
+ 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
+ def ensure_token!
+ @access_token = Oauth2Token.find!(:token => params[:access_token])
end
end