Skip to content

upcoming: [M3-7814, M3-7819] - Fix Account Switching - #10234

Merged
jaalah-akamai merged 6 commits into
linode:developfrom
jaalah-akamai:M3-7814
Feb 27, 2024
Merged

jaalah-akamai merged 6 commits into
linode:developfrom
jaalah-akamai:M3-7814

Conversation

@jaalah-akamai

Copy link
Copy Markdown
Contributor

Description 📝

There were a few issues with proxy tokens and loading child users for proxy accounts.

Changes 🔄

  • The prefix Bearer was missing from the proxy token sending us back to login upon switching.
  • We were always passing the current token to ChildAccountList which prevented us from fetching child accounts while in a proxy account. This token needs to be the parent token when logged in as a proxy.

Target release date 🗓️

03/04/2024

Preview 📷

parent-child.mp4

How to test 🧪

Prerequisites

(How to setup test environment)

  • You need to create parent & child accounts (see me if you want to)

Verification steps

  • Log into dev using parent account creds
  • Open user menu and click "Switch Accounts"
  • Observe children load
  • Select any child accounts and observe page refresh
  • You should now be in proxy account
  • Open user menu and click "Switch Accounts"
  • Observe children load
  • Click "switch back to your account" and observe you should now be back in the parent account.

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

// We don't need to worry about this if we're a proxy user.
if (!isProxyUser) {
const parentToken = {
const parentToken: Token = {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

More type safety

@jaalah-akamai
jaalah-akamai marked this pull request as ready for review February 27, 2024 21:16
@jaalah-akamai
jaalah-akamai requested a review from a team as a code owner February 27, 2024 21:16
@jaalah-akamai
jaalah-akamai requested review from abailly-akamai and mjac0bs and removed request for a team February 27, 2024 21:16
@mjac0bs mjac0bs changed the title upcoming: [M3-7814] - Fix Account Switching upcoming: [M3-7814, M3-7819] - Fix Account Switching Feb 27, 2024

@mjac0bs mjac0bs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • From a parent account, I can switch to a proxy account.
  • From a proxy account, I can switch to another proxy account.
  • From a proxy account, I can switch back to a parent account.

Comment thread packages/manager/src/features/Account/SwitchAccountDrawer.tsx Outdated
Comment thread packages/manager/src/features/Account/SwitchAccountDrawer.tsx Outdated
@github-actions

github-actions Bot commented Feb 27, 2024 •

Copy link
Copy Markdown

Coverage Report: ✅
Base Coverage: 81.34%
Current Coverage: 81.34%

jaalah-akamai and others added 2 commits February 27, 2024 17:01
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
Co-authored-by: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com>
@jdamore-linode
jdamore-linode self-requested a review February 27, 2024 22:01
@jaalah-akamai
jaalah-akamai requested a review from a team as a code owner February 27, 2024 22:05
@jaalah-akamai
jaalah-akamai requested review from cliu-akamai and removed request for a team February 27, 2024 22:05

@jdamore-linode jdamore-linode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎉 Awesome! Confirmed that the tests now pass without the workarounds (and pushed a commit with those workarounds removed). Feels like a big milestone!

@mjac0bs mjac0bs added Approved Multiple approvals and ready to merge! and removed Ready for Review labels Feb 27, 2024
@jaalah-akamai
jaalah-akamai merged commit e255d5b into linode:develop Feb 27, 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.

4 participants