Skip to content

OTWO-7710 Invaidate concurrent session when password is changed - #1932

Open
bd-vaibhav wants to merge 1 commit into
stagingfrom
OTWO-7710
Open

OTWO-7710 Invaidate concurrent session when password is changed#1932
bd-vaibhav wants to merge 1 commit into
stagingfrom
OTWO-7710

Conversation

@bd-vaibhav

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the password-change flow so that changing a password invalidates other concurrent sessions by rotating the account’s remember_token, while keeping the current session authenticated.

Changes:

  • Rotate remember_token as part of the password update transaction, then re-sign-in to refresh the current session cookie.
  • Fix valid_current_password? to return a boolean and only add an error when invalid.
  • Add a controller test intended to verify token rotation on successful password change.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
test/controllers/alter_passwords_controller_test.rb Adds coverage for remember_token rotation during password change.
app/models/concerns/account_validations.rb Corrects current-password validation method to return a proper boolean result and add errors conditionally.
app/controllers/alter_passwords_controller.rb Implements password update + remember-token rotation and re-authentication on success.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/controllers/alter_passwords_controller_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants