Class: GrapeDeviseAuth::AuthHeaders
- Inherits:
-
Object
- Object
- GrapeDeviseAuth::AuthHeaders
- Extended by:
- Forwardable
- Defined in:
- lib/grape_devise_auth/auth_headers.rb
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(warden, mapping, request_start, data) ⇒ AuthHeaders
constructor
A new instance of AuthHeaders.
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
#headers ⇒ Object
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 |