Skip to content

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

@vmorgado

Description

@vmorgado

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions