Class: GrapeDeviseAuth::AuthHeaders

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/grape_devise_auth/auth_headers.rb

Instance Method Summary collapse

Constructor Details

#initialize(warden, mapping, request_start, data) ⇒ AuthHeaders

Returns a new instance of AuthHeaders.



5
6
7
8
9
# File 'lib/grape_devise_auth/auth_headers.rb', line 5

def initialize(warden, mapping, request_start, data)
  @resource = warden.user(mapping)
  @request_start = request_start
  @data = data
end

Instance Method Details

#headersObject



11
12
13
14
# File 'lib/grape_devise_auth/auth_headers.rb', line 11

def headers
  return {} unless resource && resource.valid? && client_id
  auth_headers_from_resource
end