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
Getting an uncaught error in the react quick start example #70
Comments
do you have a code snippet? what lib version is this? |
I think this bug has something to do with authorization from what I got from the logs and I am using "@auth0/auth0-spa-js": "^1.0.2". What I have tried:
|
do you have a HAR file I can take a look? You can send it to luis.rudge at auth0.com |
@mcyleung just sent me an e-mail with a log and with the following text:
If anyone hits this again, please open a new issue so we can investigate. Thanks @mcyleung for following up by email! |
Getting the same issue. Trying to login using gmail. Login is succesful but on Approving access to the application, the page redirects to http://localhost:3000/?code=YpqazoJ6B_RazjFx&state=Mm05b19LSlZSekxaTGpnZGR1aHhBNnF%2BSkhiczZneHI3dm91anI3NEF5RA%3D%3D and gives the error in console. Check attached screeenshot Kindly help resolve. |
Can you inspect why your oauth/token http request is failing? This will help you solve this issue. Maybe it's a rule or something? |
I'm having this issue as well. I cannot figure out why the token request is getting a 401. In the Auth0 logs it shows a "Failed Exchange" due to "Unauthorized". Is there anything specific I should look into to understand what's causing it? I have no rules FWIW. Thanks |
@zuercherm Can you check if your client was created as an SPA client? I saw this happening with clients that weren't configured as SPA. |
I just tested it here and if I have my client setup as a Regular Web Application, it fails. So, make sure your client is the correct type. I also opened #116 to improve the developer experience when facing those types of errors 🎉 |
Yep – that fixed it. Thank you.
From: Luís Rudge <notifications@github.com>
Reply-To: auth0/auth0-spa-js <reply@reply.github.com>
Date: Friday, July 26, 2019 at 2:39 PM
To: auth0/auth0-spa-js <auth0-spa-js@noreply.github.com>
Cc: Michael Zuercher <michael@zuerchermail.com>, Mention <mention@noreply.github.com>
Subject: Re: [auth0/auth0-spa-js] Getting an uncaught error in the react quick start example (#70)
I just tested it here and if I have my client setup as a Regular Web Application, it fails. So, make sure your client is the correct type.
[image]<https://user-images.githubusercontent.com/941075/61975132-b5304f80-afbe-11e9-9d71-6acad1c167b3.png>
[image]<https://user-images.githubusercontent.com/941075/61975141-b95c6d00-afbe-11e9-973f-ca4bd2cfe8f9.png>
I also opened #116<#116> to improve the developer experience when facing those types of errors 🎉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#70?email_source=notifications&email_token=AFUAZHF2CAL3Y5MWBWLNFJ3QBNHG5A5CNFSM4IDSEJZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD25Q37I#issuecomment-515575293>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFUAZHH5Z3RJQTXR4U2YCR3QBNHG5ANCNFSM4IDSEJZA>.
|
I am still encountering this error following the Angular quick start guide. My application is configured as a single page application. I am able to sign in and hit the callback page. The token comes back without error, but I get this message when calling |
@BenjaminRichardson sorry, I missed this. Did you fix it? Can you check your tenant logs? Other users were having this when you have a custom rule or when the token exchange fails for some reason. This would appear in the tenant logs. |
@luisrudge The tenant logs say the authorization code for access token was successful. |
Ok we do have custom rules in place. Does this library just not support custom rules at all, or is one of our rules adding something unexpected to the response objects? I've looked through the documentation and cannot find an answer. |
There's an issue that happens when the code exchange fails (which is what is happening). We have a fix in place #116. This will be out in the next release, targeted at next week. |
@luisrudge Thanks for info and the quick follow up. I'll follow up after trying with the next release. |
Hello @luisrudge , I'm hitting this issue too. This is the error I get: I get the same error in the logs I'm using I also have an API setup as I authorise people to my API via the retrieved token in the SPA. Thank you in advance |
@afrancht I'm having the same issue. Did you figure this out? |
For anyone else having issues here - I had exactly the same problem when configuring for a React SPA. The settings were correct, but I swapped the Application type to Regular Web Application - saved (this failed as expected). I then swapped the Application type back to SPA, and it all worked as expected. |
Quick follow up, the issue in my situation was that we had a rule in place which modified the scope of the token. This caused issues when using the token in further authentication steps. After we removed the rule and everything worked smoothly. |
I am getting the following error in the download sample that you guys have provided for the react quick start of auth0
Uncaught (in promise) TypeError: Cannot read property 'split' of undefined
at auth0-spa-js.production.js:685
The text was updated successfully, but these errors were encountered: