Class: TwoFactorMailer
- Inherits:
-
ApplicationMailer
- Object
- ActionMailer::Base
- ApplicationMailer
- TwoFactorMailer
- Defined in:
- app/mailers/two_factor_mailer.rb
Instance Method Summary collapse
Instance Method Details
#backup_code ⇒ Object
20 21 22 23 24 |
# File 'app/mailers/two_factor_mailer.rb', line 20 def backup_code @user = params[:user] @host = params[:host] mail to: @user.email, subject: 'Your 2FA backup code for Codidact' end |
#disable_email ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/mailers/two_factor_mailer.rb', line 4 def disable_email user = params[:user] @host = params[:host] @token = SecureRandom.urlsafe_base64(64) user.update(login_token: @token, login_token_expires_at: 5.minutes.from_now) mail to: user.email, subject: 'Disable two-factor authentication on Codidact' end |
#login_email ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/mailers/two_factor_mailer.rb', line 12 def login_email user = params[:user] @host = params[:host] @token = SecureRandom.urlsafe_base64(64) user.update(login_token: @token, login_token_expires_at: 5.minutes.from_now) mail to: user.email, subject: 'Your sign in link for Codidact' end |