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

Logout function clears the store before executing the http call #348

Open
vmorgado opened this issue Sep 7, 2021 · 0 comments
Open

Logout function clears the store before executing the http call #348

vmorgado opened this issue Sep 7, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@vmorgado
Copy link

vmorgado commented Sep 7, 2021

Describe the bug
When triggering this.$auth.logout() while having the option makeRequest: true makes the request to the backend with the Authorization token set to Bearer null.

After reading the code, in case makeRequest is true, after leaving the if condition, it will clear the store data before the timing that the promise resolves, leading to the token to used be null.

To Reproduce

  1. Create a basic example
  2. Set the logoutData option makeRequest to true in order to call the backend
  3. Execute $auth.logout()
  4. In the headers the request Authorization header will be: Bearer null

Expected behavior

  • In case makeRequest is enabled for logout the store should only be clean on resolve of the promise
@d0whc3r d0whc3r self-assigned this Sep 8, 2021
@d0whc3r d0whc3r added the bug Something isn't working label Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants