Smooth out the finder API
This commit is contained in:
committed by
Stanko K.R.
parent
0ba43de61a
commit
caa4cd491e
@@ -14,6 +14,10 @@ class Identity < ApplicationRecord
|
||||
validates :email_address, format: { with: URI::MailTo::EMAIL_REGEXP }
|
||||
normalizes :email_address, with: ->(value) { value.strip.downcase.presence }
|
||||
|
||||
def self.find_by_access_token(token)
|
||||
AccessToken.find_by(token: token)&.identity
|
||||
end
|
||||
|
||||
def send_magic_link(**attributes)
|
||||
attributes[:purpose] = attributes.delete(:for) if attributes.key?(:for)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user