Class: ReviseAuth::EmailController
- Inherits:
-
ReviseAuthController
- Object
- ApplicationController
- ReviseAuthController
- ReviseAuth::EmailController
- Defined in:
- app/controllers/revise_auth/email_controller.rb
Instance Method Summary collapse
-
#show ⇒ Object
GET /profile/email?confirmation_token=abcdef.
- #update ⇒ Object
Instance Method Details
#show ⇒ Object
GET /profile/email?confirmation_token=abcdef
5 6 7 8 9 10 11 12 |
# File 'app/controllers/revise_auth/email_controller.rb', line 5 def show if User.find_by_token_for(:email_verification, params[:confirmation_token])&.confirm_email_change flash[:notice] = t(".email_confirmed") redirect_to(user_signed_in? ? profile_path : root_path) else redirect_to root_path, alert: t(".email_confirm_failed") end end |
#update ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/controllers/revise_auth/email_controller.rb', line 14 def update if current_user.update(email_params) current_user.send_confirmation_instructions flash[:notice] = t(".confirmation_email_sent", email: current_user.unconfirmed_email) end redirect_to profile_path end |