Change confirmations controller to redirect to / for approved users (#16151)
Clicking the confirmation link multiple times currently leads to entering account settings, which can be confusing. This commit changes that so that it redirects to the root path, so it behaves the same way as clicking only once in most cases.
This commit is contained in:
parent
09bb92875d
commit
8c44b723bb
2 changed files with 49 additions and 1 deletions
|
@ -17,7 +17,9 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
|
|||
private
|
||||
|
||||
def require_unconfirmed!
|
||||
redirect_to edit_user_registration_path if user_signed_in? && current_user.confirmed? && current_user.unconfirmed_email.blank?
|
||||
if user_signed_in? && current_user.confirmed? && current_user.unconfirmed_email.blank?
|
||||
redirect_to(current_user.approved? ? root_path : edit_user_registration_path)
|
||||
end
|
||||
end
|
||||
|
||||
def set_body_classes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue