Module: Devise::Models::MagicLinkAuthenticatable::ClassMethods

Defined in:
lib/devise/models/magic_link_authenticatable.rb

Instance Method Summary collapse

Instance Method Details

#decode_passwordless_token(*args, **kwargs) ⇒ Object



86
87
88
# File 'lib/devise/models/magic_link_authenticatable.rb', line 86

def decode_passwordless_token(*args, **kwargs)
  passwordless_tokenizer_class.decode(*args, **kwargs)
end

We assume this method already gets the sanitized values from the MagicLinkAuthenticatable strategy. If you are using this method on your own, be sure to sanitize the conditions hash to only include the proper fields.



94
95
96
# File 'lib/devise/models/magic_link_authenticatable.rb', line 94

def find_for_magic_link_authentication(conditions)
  find_for_authentication(conditions)
end

#passwordless_tokenizer_classObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/devise/models/magic_link_authenticatable.rb', line 70

def passwordless_tokenizer_class
  @passwordless_tokenizer_class ||= if passwordless_tokenizer.is_a?(Class)

    passwordless_tokenizer

  else
    (
                passwordless_tokenizer.start_with?("::") ? (
                  passwordless_tokenizer.constantize
                ) : (
                  "Devise::Passwordless::#{passwordless_tokenizer}".constantize
                )
              )
  end
end