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



82
83
84
# File 'lib/devise/models/magic_link_authenticatable.rb', line 82

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.



90
91
92
# File 'lib/devise/models/magic_link_authenticatable.rb', line 90

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
# File 'lib/devise/models/magic_link_authenticatable.rb', line 70

def passwordless_tokenizer_class
  @passwordless_tokenizer_class ||= self.passwordless_tokenizer.is_a?(Class) ? (
    self.passwordless_tokenizer
  ) : (
    self.passwordless_tokenizer.start_with?("::") ? (
      self.passwordless_tokenizer.constantize
    ) : (
      "Devise::Passwordless::#{self.passwordless_tokenizer}".constantize
    )
  )
end