-
Notifications
You must be signed in to change notification settings - Fork 364
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
Unable to call getTokenSilently concurrently #109
Comments
This is probably happening because the iframe was already closed 🤔 Can you inspect dev tools and see if you're sending two requests to the /authorize endpoint? |
I've got the same problem, and there are 2 requests sent to |
Same problem, two requests. Happens only if you refresh a page after sign-in (I'm using Auth0 with Angular SPA), without refreshing it works fine and sends just one request. |
@gosuhiman @rkuprin Is it possible that you have two instances of the client? can you build a repro to help me identify why are you seeing two requests? |
Same problem if you write code like this:
If you call
And it doesn't throw exceptions now. |
This is a duplicate of my post from the auth0 community forum, but I hope it might help someome:I think I might have found the problem. Because of the observables and multiple subscriptions, there might have been concurrency issues or multiple instances of the Auth0Client. I got rid of the error by doing it this way: Create the client as shared observable in a similar way like you proposed in your updated angular quickstart:
And using it using a piped observable.
This has solved the error for me. |
Thanks for posting this @Schmaga! We recently upgraded our Angular Quickstart with the |
@luisrudge I've seen that! And I got to say that this is a waaaay better |
Hi!
I'm having an error in the console when creating the Auth0 client using
createAuth0Client()
.The error is the following:
On the beautyfied production code, the error points to this line:
And the code that's calling the
createAuth0Client()
function is this one (pretty much the exact same as the Angular Login Tutorial):Note that this error does not prevent the client to be effectively created and functionning. But it's still an unwanted error 😄
Also, some other people seem to have the same kind of issue, see this thread in the Auth0 Community Forums
The text was updated successfully, but these errors were encountered: