Module: Locomotive::Steam::Middlewares::Concerns::AuthHelpers
- Included in:
- Auth, ImpersonatedEntry
- Defined in:
- lib/locomotive/steam/middlewares/concerns/auth_helpers.rb
Instance Method Summary collapse
Instance Method Details
#authenticated? ⇒ Boolean
6 7 8 |
# File 'lib/locomotive/steam/middlewares/concerns/auth_helpers.rb', line 6 def authenticated? !!env['steam.authenticated_entry'] end |
#authenticated_entry_type ⇒ Object
10 11 12 |
# File 'lib/locomotive/steam/middlewares/concerns/auth_helpers.rb', line 10 def authenticated_entry_type request.session[:authenticated_entry_type] end |
#store_authenticated(entry) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/locomotive/steam/middlewares/concerns/auth_helpers.rb', line 14 def store_authenticated(entry) type = entry ? entry.content_type.slug : authenticated_entry_type request.session[:authenticated_entry_type] = type.to_s request.session[:authenticated_entry_id] = entry&._id.to_s env['steam.authenticated_entry'] = nil if entry.nil? log "[Auth] authenticated #{type.to_s.singularize} ##{entry&._id.to_s}" liquid_assigns["current_#{type.singularize}"] = entry end |