Skip to content
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 18 commits into from
Jul 21, 2023

Conversation

Kernapillar
Copy link
Contributor

@Kernapillar Kernapillar commented Jun 29, 2023

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

  • Bug fix (non-breaking change which fixes an issue)

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

@dorner
Copy link
Collaborator

dorner commented Jun 30, 2023

Nice! I think for tests you can create a new sessions_requests_spec for it.

@Kernapillar Kernapillar changed the title [WIP] #3673 Reset sessions when signing in #3673 Reset sessions when signing in Jul 4, 2023
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Just one comment!

spec/requests/sessions_requests_spec.rb Outdated Show resolved Hide resolved
@dorner
Copy link
Collaborator

dorner commented Jul 19, 2023

Almost there! Can you resolve the conflict in Gemfile.lock? Then I think this is good to merge.

@Kernapillar
Copy link
Contributor Author

I just resolved it! Thanks for the assistance!

@dorner
Copy link
Collaborator

dorner commented Jul 21, 2023

Looks good, thanks very much!

@dorner dorner merged commit 3415918 into rubyforgood:main Jul 21, 2023
11 checks passed
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.

Reset sessions when signing in
3 participants