diff --git a/packages/twenty-front/src/modules/apollo/services/apollo.factory.ts b/packages/twenty-front/src/modules/apollo/services/apollo.factory.ts index 6957dd5e05..bce77eb18e 100644 --- a/packages/twenty-front/src/modules/apollo/services/apollo.factory.ts +++ b/packages/twenty-front/src/modules/apollo/services/apollo.factory.ts @@ -124,12 +124,12 @@ export class ApolloFactory implements ApolloManager { uri: REST_API_BASE_URL, }); - const authLink = setContext(async (_, { headers }) => { + const authLink = setContext(async (_, { headers, skipAuthToken }) => { const tokenPair = getTokenPair(); const locale = this.currentWorkspaceMember?.locale ?? i18n.locale; - if (isUndefinedOrNull(tokenPair)) { + if (isUndefinedOrNull(tokenPair) || skipAuthToken === true) { return { headers: { ...headers, diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsx index 97f870223e..ea0d6db6be 100644 --- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx +++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx @@ -115,6 +115,7 @@ export const PasswordReset = () => { token: passwordResetToken ?? '', }, skip: !passwordResetToken || isTokenValid, + context: { skipAuthToken: true }, }, ); @@ -142,6 +143,9 @@ export const PasswordReset = () => { const [updatePasswordViaToken, { loading: isUpdatingPassword }] = useMutation( UpdatePasswordViaResetTokenDocument, + { + context: { skipAuthToken: true }, + }, ); const { signInWithCredentialsInWorkspace, signInWithCredentials } = useAuth();