-
Notifications
You must be signed in to change notification settings - Fork 80
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
verifyCredentials does not return a Promise #33
Comments
+1, either a fix of the race condition with verifyCredentials or making this return a proper promise is an absolute must for this library to be used in production. |
Also see my pull request #35 which checks for hasVerificationBeenAttempted before redirecting in the require sign in wrapper. |
Facing same issue. There is no way of knowing that validate token request has completed. So, my app renders before the server response and logs the user out. Possible workaround (Have not tried it myself yet):
Hopefully this solves it. :) EDIT: It works :) |
Great work @joshudev with this PR! I used your fork and it fixed the issue with user being redirected to sign in after typing url when user was already logged in. It was a tricky bug as at first I thought it was problem with react router. I had to add additional storage config changes as mentioned in PR discussion to make build pass. Cheers 👍 |
Hi, thanks for the time you take to make this a public module for others to use. I was happy to find it and it's working pretty good so far.
When my app launches, I'd like to see if the user is logged in via verifyCredentials. I want to wait until verifyCredentials returns before redirecting the user to their logged-in page. I don't know TypeScript well, but it looks like the TS method signature of verifyCredentials means the method will return a Promise...
I'd like my code to do this:
It seems like verifyCredentials only ever returns undefined. The method functionality doesn't return a new Promise, but the method signature implies a Promise.
How can I know that verifyCredentials is finished?
The workarounds I can think of are:
Thanks for any input you can offer.
The text was updated successfully, but these errors were encountered: