Module: Doorkeeper::Rails::Helpers

Included in:
Grape::Helpers
Defined in:
lib/doorkeeper/rails/helpers.rb

Instance Method Summary collapse

Instance Method Details

#doorkeeper_authorize!(*scopes) ⇒ Object



6
7
8
9
10
# File 'lib/doorkeeper/rails/helpers.rb', line 6

def doorkeeper_authorize!(*scopes)
  @_doorkeeper_scopes = scopes.presence || Doorkeeper.config.default_scopes

  doorkeeper_render_error unless valid_doorkeeper_token?
end

#doorkeeper_forbidden_render_optionsObject



14
# File 'lib/doorkeeper/rails/helpers.rb', line 14

def doorkeeper_forbidden_render_options(**); end

#doorkeeper_unauthorized_render_optionsObject



12
# File 'lib/doorkeeper/rails/helpers.rb', line 12

def doorkeeper_unauthorized_render_options(**); end

#valid_doorkeeper_token?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/doorkeeper/rails/helpers.rb', line 16

def valid_doorkeeper_token?
  doorkeeper_token&.acceptable?(@_doorkeeper_scopes)
end