Class: HasSecurePasskey::AuthenticateBy

Inherits:
Object
  • Object
show all
Defined in:
lib/has_secure_passkey/authenticate_by.rb

Instance Method Summary collapse

Constructor Details

#initialize(model:, params:) ⇒ AuthenticateBy

Returns a new instance of AuthenticateBy.



2
3
4
5
# File 'lib/has_secure_passkey/authenticate_by.rb', line 2

def initialize(model:, params:)
  @model = model
  @params = params
end

Instance Method Details

#authenticatedObject



7
8
9
10
11
12
13
14
# File 'lib/has_secure_passkey/authenticate_by.rb', line 7

def authenticated
  return @authenticated if defined?(@authenticated)

  @authenticated =
    if valid?
      passkey.authenticatable
    end
end