module SocialStream::Oauth2Server::Controllers::Helpers
Common methods added to ApplicationController
Public Instance Methods
authenticate_user!(opts = {})
click to toggle source
Calls superclass method
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 8 def authenticate_user!(opts = {}) oauth2_token? || super end
current_from_oauth_token(type)
click to toggle source
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 22 def current_from_oauth_token(type) return unless oauth2_token? oauth2_token.__send__(type) end
current_subject()
click to toggle source
Calls superclass method
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 12 def current_subject @current_subject ||= current_from_oauth_token(:client) || super end
current_user()
click to toggle source
Calls superclass method
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 17 def current_user @current_user ||= current_from_oauth_token(:user) || super end
oauth2_token()
click to toggle source
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 28 def oauth2_token @oauth2_token ||= request.env[Rack::OAuth2::Server::Resource::ACCESS_TOKEN] end
oauth2_token?()
click to toggle source
# File lib/social_stream/oauth2_server/controllers/helpers.rb, line 33 def oauth2_token? oauth2_token.present? end