class Macros::Auth::Authenticate

Authenticates the given user using warden. This code run at the rack level, and is tied to the request.

Public Class Methods

new() click to toggle source

@return [Macro::Auth::SignIn] step macro instance

# File lib/macros/auth/authenticate.rb, line 9
def initialize; end

Public Instance Methods

call(ctx, scope:, warden:, **) click to toggle source

Performs a step by authenticating the the given user @param ctx [Trailblazer::Skill] tbl context hash

# 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