Skip to content

Commit 9e0d243

Browse files
authored
Merge pull request #197 from OpenWebhook/authentication-flow
feature: use the latest value of the local storage instead of the val…
2 parents 11a475b + acabb50 commit 9e0d243

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/apollo.client.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ export const createApolloClient = (httpUrl: string) => {
2929
},
3030
};
3131
});
32-
var accessToken = localStorage.getItem(ACCESS_TOKEN_KEY);
3332

33+
//@Samox TODO make sure the WSlink uses the accesstoken right after it is created or refreshed
3434
const wsLink = new GraphQLWsLink(
3535
createClient({
3636
url: wsUrl,
37-
connectionParams: accessToken
38-
? {
39-
authToken: accessToken,
40-
}
41-
: {},
37+
connectionParams: {
38+
authToken: localStorage.getItem(ACCESS_TOKEN_KEY),
39+
},
4240
})
4341
);
4442

0 commit comments

Comments
 (0)