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

Don't send request to one login when signing out after impersonation #10194

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

CatalinVoineag
Copy link
Contributor

@CatalinVoineag CatalinVoineag commented Dec 18, 2024

Context

There is a small bug when login out the candidate using one login. If you logout as a candidate after impersonating the candidate we are sending request to one login to log out.

This is wrong as we didn't log in as a candidate through one login.

This PR fixes this by just redirecting to candidate sign in page if the id_token is nill, the id_token is set in the session only when one login sign in is successfull.

Changes proposed in this pull request

Guidance to review

Go on review app and impersonate a candidate user.
Sign out as a candidate user.
You should be redirected to the candidate sign in page.

Things to check

  • If the code removes any existing feature flags, a data migration has also been added to delete the entry from the database
  • This code does not rely on migrations in the same Pull Request
  • If this code includes a migration adding or changing columns, it also backfills existing records for consistency
  • If this code adds a column to the DB, decide whether it needs to be in analytics yml file or analytics blocklist, if included inform data insights team of the changes
  • If this code adds a column that may include PII, the sanitise.sql script and 0025-protecting-personal-data-in-production-dump.md ADR have been updated.
  • API release notes have been updated if necessary
  • If it adds a significant user-facing change, is it documented in the CHANGELOG?
  • Attach the PR to the Trello card

@CatalinVoineag CatalinVoineag self-assigned this Dec 18, 2024
@CatalinVoineag CatalinVoineag marked this pull request as ready for review December 18, 2024 17:07
@CatalinVoineag CatalinVoineag requested a review from a team December 18, 2024 17:08
@CatalinVoineag CatalinVoineag added the deploy_v2 Deploy the review app to AKS label Dec 19, 2024
@github-actions github-actions bot temporarily deployed to review_aks-10194 December 19, 2024 09:32 Destroyed
@github-actions github-actions bot temporarily deployed to review_aks-10194 December 19, 2024 09:45 Destroyed
Copy link
Collaborator

@avinhurry avinhurry left a comment

Choose a reason for hiding this comment

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

I'm unable to login to the review app using the bypass to test this. Am I doing something wrong? 🤔

image

spec/requests/one_login_controller_spec.rb Outdated Show resolved Hide resolved
@CatalinVoineag
Copy link
Contributor Author

I'm unable to login to the review app using the bypass to test this. Am I doing something wrong? 🤔

image

You need to use dev-candidate, that's the only bypass account we have. I've removed the create candidate feature from the form as it was a security issue if the bypass would have been enabled in production by mistake

@CatalinVoineag CatalinVoineag force-pushed the cv/fix-one-login-sign-out branch from 6a27017 to bf00204 Compare January 2, 2025 09:48
@github-actions github-actions bot temporarily deployed to review_aks-10194 January 2, 2025 09:54 Destroyed
@CatalinVoineag CatalinVoineag merged commit 04fa423 into main Jan 2, 2025
23 checks passed
@CatalinVoineag CatalinVoineag deleted the cv/fix-one-login-sign-out branch January 2, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy_v2 Deploy the review app to AKS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants