Class: DeviseLoginCookie::Strategy

Inherits:
Devise::Strategies::Authenticatable
  • Object
show all
Defined in:
lib/devise_login_cookie/strategy.rb

Constant Summary collapse

86400

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#secret_tokenObject

for non-Rails test environment.



11
12
13
# File 'lib/devise_login_cookie/strategy.rb', line 11

def secret_token
  @secret_token
end

Instance Method Details

#authenticate!Object



17
18
19
20
21
22
23
# File 'lib/devise_login_cookie/strategy.rb', line 17

def authenticate!
  if fresh?(cookie) && resource && validate(resource)
    success!(resource)
  else
    pass
  end
end

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/devise_login_cookie/strategy.rb', line 13

def valid?
  cookie.valid?
end