Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Remind users to login again after password update
Browse files Browse the repository at this point in the history
Upon password update, users should `docker login` again, otherwise
push/pull command will fail.

Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Sep 19, 2018
1 parent 8117995 commit 066f06f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions app/controllers/auth/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,22 @@ def edit
end

def update
msg = "Profile updated successfully!"

success =
if password_update?
succ = current_user.update_with_password(user_params)
bypass_sign_in(current_user) if succ
if succ
bypass_sign_in(current_user)
msg += " Remember to login again on the Docker CLI."
end
succ
else
current_user.update_without_password(params.require(:user).permit(:email, :display_name))
end

if success
redirect_to edit_user_registration_path,
notice: "Profile updated successfully!", float: true
redirect_to edit_user_registration_path, notice: msg, float: true
else
redirect_to edit_user_registration_path,
alert: resource.errors.full_messages, float: true
Expand Down
4 changes: 2 additions & 2 deletions config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ en:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
updated: "Your password has been changed successfully. You are now signed in."
updated_not_active: "Your password has been changed successfully."
updated: "Your password has been changed successfully. You are now signed in. Remember to login again on the Docker CLI."
updated_not_active: "Your password has been changed successfully. Remember to login again on the Docker CLI."
registrations:
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
Expand Down

0 comments on commit 066f06f

Please sign in to comment.