Module: Balrog::Guard

Included in:
Helpers, RoutesMiddleware
Defined in:
lib/balrog/guard.rb

Overview

Contains authentication logic to check the user has been authenticated, and that the session hasn’t expired.

Instance Method Summary collapse

Instance Method Details

#authenticated?(balrog_session) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/balrog/guard.rb', line 4

def authenticated?(balrog_session)
  @balrog_session = balrog_session&.with_indifferent_access
  previously_authenticated? && still_valid?
end