Class: Devise::Strategies::Auth0

Inherits:
Base
  • Object
show all
Defined in:
lib/devise/strategies/auth0.rb

Overview

Warden strategy to authenticate an user through a JWT token in the ‘Authorization` request header

Instance Method Summary collapse

Instance Method Details

#authenticate!Object



21
22
23
24
25
26
27
28
# File 'lib/devise/strategies/auth0.rb', line 21

def authenticate!
  if token.valid?
    resource = mapping.to.from_auth0_token(token)
    return success!(resource) if resource.persisted?
  end

  fail!(:invalid)
end

#store?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/devise/strategies/auth0.rb', line 17

def store?
  false
end

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/devise/strategies/auth0.rb', line 13

def valid?
  !auth.nil?
end