Skip to content

Migrating to AccountsJS JWT from Meteor Login Token #1218

Discussion options

You must be logged in to vote

Fumbled my way through figuring this out:

Our existing UserSignIn mutation now returns LoginResult obtained from calling AccountsServer.loginWithService() in the UserSignIn resolver method, which we then add to localstorage using AccountsClient.setTokens() in the Apollo Client UserSignIn mutation subscription handler, allowing us to return the token in the headers using ApolloLink and in the Subscriptions WebSocket connection parameters using AccountsClient.getTokens(). Our UserSignOut mutation then calls AccountsServer.logout() with the Apollo Client UserSignOut mutation subscription handler calling AccountsClient.clearTokens().

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KeithGillette
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant