Skip to content

Commit

Permalink
refactor: Improve Apollo auth link with explicit return and context s…
Browse files Browse the repository at this point in the history
…etting
  • Loading branch information
bigint committed Mar 6, 2025
1 parent 18fa7c0 commit e710f46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/helpers/authLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const executeTokenRefresh = async (
}

signIn({ accessToken, idToken, refreshToken: newRefreshToken });

return accessToken;
} catch (error) {
signOut();
Expand Down Expand Up @@ -89,6 +90,7 @@ const authLink = new ApolloLink((operation, forward) => {
operation.setContext({
headers: { "X-Access-Token": accessToken }
});

return forward(operation);
}

Expand Down

0 comments on commit e710f46

Please sign in to comment.