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

login() and fetchData() return incomplete promises #350

Open
Glandos opened this issue Sep 8, 2021 · 0 comments
Open

login() and fetchData() return incomplete promises #350

Glandos opened this issue Sep 8, 2021 · 0 comments
Assignees

Comments

@Glandos
Copy link
Contributor

Glandos commented Sep 8, 2021

Describe the bug
Calling $auth.login() returns a promise that will resolve right after login, but before the call (and the result) of fetchData.

To Reproduce

  • Call await Vue.$auth.login(…)
  • Call Vue.$auth.user() right after
  • The returned value is null.

https://codepen.io/glandos/pen/YzQNjeB?editors=1112
You can see that loginNotOK follow the pattern of the current code, while loginOK returns the result of the promise.then call.

Expected behavior
login returned promise should resolve when all information are there. Especially, this code should be valid:

await Vue.$auth.login({username, password})
assert Vue.$auth.user() !== null

This is not the case today.

Is this a wanted behavior? Should I opened a PR to fix that?

@d0whc3r d0whc3r self-assigned this Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants