Class: Searls::Auth::DeliversPasswordReset

Inherits:
Object
  • Object
show all
Defined in:
lib/searls/auth/delivers_password_reset.rb

Defined Under Namespace

Classes: Result

Instance Method Summary collapse

Instance Method Details

#deliver(user:, redirect_path: nil, redirect_subdomain: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/searls/auth/delivers_password_reset.rb', line 6

def deliver(user:, redirect_path: nil, redirect_subdomain: nil)
  token = Searls::Auth.config.password_reset_token_generator.call(user)
  PasswordResetMailer.with(
    user:,
    token:,
    redirect_path:,
    redirect_subdomain:
  ).password_reset.deliver_later
  Result.new(success?: true)
end