-
-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#3673 Reset sessions when signing in #3700
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nice! I think for tests you can create a new |
Kernapillar
changed the title
[WIP] #3673 Reset sessions when signing in
#3673 Reset sessions when signing in
Jul 4, 2023
dorner
requested changes
Jul 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment!
Almost there! Can you resolve the conflict in Gemfile.lock? Then I think this is good to merge. |
I just resolved it! Thanks for the assistance! |
dorner
approved these changes
Jul 21, 2023
Looks good, thanks very much! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #3673
Description
I added a before_action and sign_out_if_signed_in method to the sessions controller to terminate any active session before attempting to log into a new one.
I labeled this as WIP because Im not 100% sure where to add the tests yet, feedback is very much appreciated!
Type of change
How Has This Been Tested?
As stated in the original issue, I recreated the issue with the following steps:
1/ login as org_admin1@example.com
2/ Go to users/sign_in/ .
3/ Sign in as verified@example.com.
4/ You are now at the diaper bank dashboard. Verified@example.com shouldn't ever see that.
After the change, signing into the verified@example.com account while currently logged in as an admin brought me to the partners dashboard instead of the diaper bank dashboard.
sessions_requests_spec.rb file added to test this issue