Skip to content

Commit cf93dd2

Browse files
authored
Merge pull request #252 from OpenWebhook/sammyt/fix-undefined-access-token-after-login
feature: use arrow function to get token from storage for each request
2 parents 382f155 + 73f5617 commit cf93dd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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)