From 70b52424b76bfdbbe896adddb58fb0228decb6c8 Mon Sep 17 00:00:00 2001 From: Mariah Jacobs <114685994+mjac0bs@users.noreply.github.com> Date: Thu, 1 Feb 2024 14:22:25 -0700 Subject: [PATCH] fix: [M3-7728] - Token issues when account switching (#10138) --- .../manager/src/features/Account/SwitchAccountDrawer.tsx | 6 +++--- packages/manager/src/mocks/serverHandlers.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/manager/src/features/Account/SwitchAccountDrawer.tsx b/packages/manager/src/features/Account/SwitchAccountDrawer.tsx index 987bff1687b..87e8f3ce37f 100644 --- a/packages/manager/src/features/Account/SwitchAccountDrawer.tsx +++ b/packages/manager/src/features/Account/SwitchAccountDrawer.tsx @@ -62,7 +62,7 @@ export const SwitchAccountDrawer = (props: Props) => { headers: userType === 'proxy' ? { - Authorization: `Bearer ${token}`, + Authorization: token, } : undefined, }); @@ -105,8 +105,8 @@ export const SwitchAccountDrawer = (props: Props) => { // We don't need to worry about this if we're a proxy user. if (!isProxyUser) { const parentToken = { - expiry: getStorage('authenication/expire'), - scopes: getStorage('authenication/scopes'), + expiry: getStorage('authentication/expire'), + scopes: getStorage('authentication/scopes'), token: currentTokenWithBearer ?? '', }; diff --git a/packages/manager/src/mocks/serverHandlers.ts b/packages/manager/src/mocks/serverHandlers.ts index 8bc3ef43c29..6d2552aa742 100644 --- a/packages/manager/src/mocks/serverHandlers.ts +++ b/packages/manager/src/mocks/serverHandlers.ts @@ -552,7 +552,7 @@ export const handlers = [ const profile = profileFactory.build({ restricted: false, // Parent/Child: switch the `user_type` depending on what account view you need to mock. - user_type: 'proxy', + user_type: 'parent', }); return res(ctx.json(profile)); }),