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

fix: [M3-7728] - Token issues when account switching #10138

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

mjac0bs
Copy link
Contributor

@mjac0bs mjac0bs commented Feb 1, 2024

Description 📝

This PR fixes a couple of issues impacting account switching:

  1. Fixes a typo introduced here that was causing a parent token's scopes and expiry to not be fetched and then stored correctly from local storage, causing the "switch" back to a parent account (which relies on the stored parent's token in local storage) to fail.
  2. Fixes a bug where "Bearer" would have been included twice in an auth token.

This PR also changes the user_type back to parent in the MSW. This doesn't really matter, but we've used a default of parent throughout this project so it's helpful to keep it the same default for consistency.

Preview 📷

Before After
image Screenshot 2024-02-01 at 10 54 14 AM

How to test 🧪

Prerequisites

(How to setup test environment)

  • Check out this PR.
  • Turn the Parent/Child feature flag on and MSW on.

Reproduction steps

(How to reproduce the issue, if applicable)

  • On develop, try to account switch from a proxy account back to a parent account and observe the error and lack of parent's auth token data stored in local storage.

Verification steps

(How to verify changes)

  • Follow the testing steps here to confirm that token swapping is behaving as expected.

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@mjac0bs mjac0bs self-assigned this Feb 1, 2024
@mjac0bs mjac0bs marked this pull request as ready for review February 1, 2024 17:59
@mjac0bs mjac0bs requested a review from a team as a code owner February 1, 2024 17:59
@mjac0bs mjac0bs requested review from bnussman-akamai, hana-akamai and jaalah-akamai and removed request for a team February 1, 2024 17:59
Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Thanks

@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Feb 1, 2024
Copy link
Contributor

@jdamore-linode jdamore-linode left a comment

Choose a reason for hiding this comment

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

Thanks @mjac0bs!

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Feb 1, 2024
@mjac0bs mjac0bs changed the title fix: Token issues when account switching fix: [M3-7728] - Token issues when account switching Feb 1, 2024
@mjac0bs
Copy link
Contributor Author

mjac0bs commented Feb 1, 2024

CI test failure was on resize-linode.spec.ts and is unrelated to this PR. Merging now.

@mjac0bs mjac0bs merged commit 70b5242 into linode:develop Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Parent / Child Account
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants