Skip to content

Commit 73f5617

Browse files
committed
feature: use arrow function to get token from storage for each request
1 parent 382f155 commit 73f5617

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/apollo.client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ export const createApolloClient = (httpUrl: string) => {
3030
};
3131
});
3232

33-
//@Samox TODO make sure the WSlink uses the accesstoken right after it is created or refreshed
3433
const wsLink = new GraphQLWsLink(
3534
createClient({
3635
url: wsUrl,
37-
connectionParams: {
36+
connectionParams: () => ({
3837
authToken: localStorage.getItem(ACCESS_TOKEN_KEY),
39-
},
38+
}),
4039
})
4140
);
4241

0 commit comments

Comments
 (0)