Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accounts client link issues #918

Open
sakulstra opened this issue Mar 28, 2020 · 0 comments
Open

accounts client link issues #918

sakulstra opened this issue Mar 28, 2020 · 0 comments
Labels

Comments

@sakulstra
Copy link
Contributor

Bug report

Accounts apollo client doesn't remove client-side token on logout error keeping it in an invalid state.

Describe the bug

In our dev environment we periodically prune the database pushing users that didn't logout before in an invalid state. The problem as I get it, is that client.logout() throws when the session does not exist and therefore the client token in local storage/cookies are not removed.

To Reproduce

  1. login via apollo-client
  2. drop database
  3. try to logout
Uncaught (in promise) Error: GraphQL error: Tokens are not valid
  1. cookie/localStorage will still be set

Expected behavior

You should be able to get into a valid state without workarounds

System information

  • Version of accounts-js: 0.0.24

Additional context

I already checked the source, but am not quite sure where to fix this issue:

  1. one could just not throw in https://github.com/accounts-js/accounts/blob/master/packages/graphql-api/src/modules/accounts/resolvers/mutation.ts#L49
  2. one could catch the error in https://github.com/accounts-js/accounts/blob/master/packages/client/src/accounts-client.ts#L193 & logout on this kind of error

I'd be happy to fix this, i'm just not sure yet where to look at

@sakulstra sakulstra added the bug label Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant