Class: Macros::Auth::Authenticate
- Defined in:
- lib/macros/auth/authenticate.rb
Overview
Authenticates the given user using warden. This code run at the rack level, and is tied to the request.
Instance Method Summary collapse
-
#call(ctx, scope:, warden:) ⇒ Object
Performs a step by authenticating the the given user.
-
#initialize ⇒ Macro::Auth::SignIn
constructor
Step macro instance.
Methods inherited from Base
Constructor Details
#initialize ⇒ Macro::Auth::SignIn
Returns step macro instance.
9 |
# File 'lib/macros/auth/authenticate.rb', line 9 def initialize; end |
Instance Method Details
#call(ctx, scope:, warden:) ⇒ Object
Performs a step by authenticating the the given user
13 14 15 16 17 18 19 20 21 |
# File 'lib/macros/auth/authenticate.rb', line 13 def call(ctx, scope:, warden:, **) user = warden.authenticate(scope: scope) if user ctx[:model] = user true else false end end |