diff --git a/lib/server/helpers/minimal-auth.ts b/lib/server/helpers/minimal-auth.ts index 5bcd8aaeb..ac3c8c0e7 100644 --- a/lib/server/helpers/minimal-auth.ts +++ b/lib/server/helpers/minimal-auth.ts @@ -26,7 +26,7 @@ export const minimalAuth = async (ctx: IExtRemixCtx) => { if ( whoAmI.errors && - whoAmI.errors[0].message === 'input: auth_me user not logged in' + whoAmI.errors[0].message === 'input: auth_me Unauthorized' ) { return redirect(`${authBaseUrl}/login`); } diff --git a/src/apps/console/routes/_a+/teams.tsx b/src/apps/console/routes/_a+/teams.tsx index 4653c453e..7c798c360 100644 --- a/src/apps/console/routes/_a+/teams.tsx +++ b/src/apps/console/routes/_a+/teams.tsx @@ -30,7 +30,7 @@ export const loader = async (ctx: IRemixCtx) => { {} ); if (errors) { - return handleError(errors[0]); + throw errors[0]; } accounts = data; @@ -55,6 +55,7 @@ export const loader = async (ctx: IRemixCtx) => { } catch (err) { return handleError(err); } + return { accounts: accounts || [], invites: invites || [],