diff options
author | Brett Walker <brett@digitalmoksha.com> | 2017-09-04 20:23:33 +0300 |
---|---|---|
committer | Brett Walker <brett@digitalmoksha.com> | 2017-09-23 16:23:11 +0300 |
commit | f9f467227538df0ce2012df39dfdcf55fb260f94 (patch) | |
tree | 7ebabd8226e6db955d77ca456406197b6a8c0e6b /app/controllers/confirmations_controller.rb | |
parent | b14641579855a14398db260ab909ae77c164c883 (diff) |
Send a confirmation email when the user adds a secondary email address. Utilizes the Devise `confirmable` capabilities. Issue #37385
Diffstat (limited to 'app/controllers/confirmations_controller.rb')
-rw-r--r-- | app/controllers/confirmations_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index 306afb65f10..51c26b9c17e 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -11,11 +11,12 @@ class ConfirmationsController < Devise::ConfirmationsController end def after_confirmation_path_for(resource_name, resource) - if signed_in?(resource_name) + # incoming resource can either be a :user or an :email + if signed_in?(:user) after_sign_in_path_for(resource) else flash[:notice] += " Please sign in." - new_session_path(resource_name) + new_session_path(:user) end end end |