Module: Rodauth::OAuth::ControllerMethods

Defined in:
lib/rodauth/oauth/railtie.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(controller) ⇒ Object



6
7
8
9
# File 'lib/rodauth/oauth/railtie.rb', line 6

def self.included(controller)
  # ActionController::API doesn't have helper methods
  controller.helper_method :current_oauth_account, :current_oauth_application if controller.respond_to?(:helper_method)
end

Instance Method Details

#current_oauth_account(name = nil) ⇒ Object



11
12
13
# File 'lib/rodauth/oauth/railtie.rb', line 11

def (name = nil)
  rodauth(name).
end

#current_oauth_application(name = nil) ⇒ Object



15
16
17
# File 'lib/rodauth/oauth/railtie.rb', line 15

def current_oauth_application(name = nil)
  rodauth(name).current_oauth_application
end