Class: Warden::CookieSession::Strategy
- Inherits:
-
Strategies::Base
- Object
- Strategies::Base
- Warden::CookieSession::Strategy
- Defined in:
- lib/warden/cookie_session/strategy.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.encrypted_cookie(cookies) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/warden/cookie_session/strategy.rb', line 28 def self.() Warden::CookieSession::EncryptedCookie.new( store: , cookie: Warden::CookieSession.config., secret: Warden::CookieSession.config.secret ) end |
Instance Method Details
#authenticate! ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/warden/cookie_session/strategy.rb', line 17 def authenticate! key, salt = @key_salt || .get record = Warden::CookieSession.config.fetch_record(key) success!(record) if record && Warden::CookieSession.config.validate_record(record, salt) rescue StandardError => e logger.warn "Warden::CookieSession::Strategy failed: #{e}" fail!(e) logger.debug { e.backtrace } end |
#encrypted_cookie ⇒ Object
36 37 38 |
# File 'lib/warden/cookie_session/strategy.rb', line 36 def @encrypted_cookie ||= Warden::CookieSession::Strategy.() end |
#store? ⇒ Boolean
13 14 15 |
# File 'lib/warden/cookie_session/strategy.rb', line 13 def store? false end |
#valid? ⇒ Boolean
5 6 7 8 9 10 11 |
# File 'lib/warden/cookie_session/strategy.rb', line 5 def valid? @key_salt = [Warden::CookieSession.config.] && .get.presence rescue StandardError => e logger.warn "Warden::CookieSession::Strategy#valid? failed: #{e}" logger.debug { e.backtrace } false end |