Comments (17)
I created a completely new and fresh angular cli app. https://github.com/HIAB-vesteel/auth0-missing-default
Just added auth0 as in the guide Angular: Login untill the section showing-profile-information.
Pull the solution down. run npm install
and ng test
Only difference is empty object gets error in TS as its not matching type so i cast it with as:
If i instead actually try to add redirect url like below i get a new error:
Happy hunting
from auth0-spa-js.
@stevehobbsdev Sorry man, end of the work day and i forgot the commit. Now its updated
from auth0-spa-js.
Hi @ibraelillo, another issue was raised with the same error, but in the Angular sample. It looked like it was because of a tsconfig
problem: #45
Does anything in that issue help you?
from auth0-spa-js.
Hi @stevehobbsdev ,
I've already tried that example, and if I change my tsconfig.json then it breaks the platform. My auth component is part of a library which contains a lot of other components which are working with the current typescript config. The library is also shared between 3 other different apps, so, I have no choice but to find out what's happening.
As a context, I'm working with :
- nextjs 8.1.0
- next-with-typescript.
When I do ssr, it works well on the backend because the cjs generated module works fine, but then on the frontend it's raising the error from the auth0-spa-js.production.js file.
from auth0-spa-js.
@ibraelillo can you create a simple repo with next+typescript and configs you're using that replicates the problem? I'll clone it and try to find the issue.
from auth0-spa-js.
I´m just noting that i have the same error when running unit test in Karma.
I have the same AuthService as the tutorial right now.
In my navbar component i have the below code. In the navbar test i avoided/missed to mock the calls to auth0.
async ngOnInit() {
this.auth0Client = await this.authService.getAuth0Client();
.....
}
With #45 implemented unit test passes but in "afteall" i still get this
Don´t know if this could help you in the correct direction.
I´m still going for the mock approach so this won't be a problem in my case.
from auth0-spa-js.
@ibraelillo @HIAB-vesteel I think in order to progress this, a small repro case that you can share would be the most useful thing to help us.
from auth0-spa-js.
@HIAB-vesteel Are you missing some commits? I can't see anywhere in that project where Auth0 is used, and all the tests pass.
from auth0-spa-js.
@HIAB-vesteel The app looks fine from the point of view that it works. If I configure it with a valid domain and client ID then I can log in and use the app just fine. So it looks like the error has to do with how it's being tested. The tests are peculiar because it's the Navbar creation test which is failing, yet the error is being thrown by the call to handleRedirectCallback
from the CallbackComponent
. I'm not sure how that's happening.
Only difference is empty object gets error in TS as its not matching type
FYI if you update to [email protected]
, loginWithRedirect
now accepts an empty parameter list, which should fix that.
@ibraelillo I'm almost sure that the problems you are having are to do with a misconfiguration somewhere. Could you please check out this FAQ question and come back to us once you've done that? Also, a repro app would be extremely helpful at this point.
from auth0-spa-js.
I'm seeing the same issue. I create a sample app for React that works fine the first time that the user logs in, but when the page is refreshed the call to createAuth0Client() hangs. This means that the auth client is never set and downstream code chokes. I'm very new to auth0, so I could have something wrong but I can't seem to figure it out. The code for my sample can be found here: https://github.com/gurneyds/test-auth
from auth0-spa-js.
@gurneyds can you see if this helps? https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-does-the-auth0client-object-take-a-long-time-to-initialize
from auth0-spa-js.
I'm just trying to run the sample locally, so the values for "Allowed Callback URLs", "Allowed Web Origins", "Allowed Logout URLs" and "Allowed Origins (CORS)
" are all set to "http://localhost:3000/". The application does login the first time the page is refreshed. Clicking on the "Profile" link also works - UNTIL the page is reloaded, then it hangs on the call to "createAuth0Client". I've added some console.log statements to the code:
1111111111111111111111 auth wrapper before Auth0Provider
react-auth0-wrapper.js:16 2222222222222222222222 auth wrapper inside Auth0Provider
react-auth0-wrapper.js:25 3333333333333333333333 auth wrapper inside useEffect()
react-auth0-wrapper.js:28 4444444444444444444444 auth wrapper before createAuth0Client()
authorize:1 Failed to load resource: the server responded with a status of 400 ()
Clicking on the 'login' link then gives the following errors:
1111111111111111111111 auth wrapper before Auth0Provider
react-auth0-wrapper.js:16 2222222222222222222222 auth wrapper inside Auth0Provider
react-auth0-wrapper.js:25 3333333333333333333333 auth wrapper inside useEffect()
react-auth0-wrapper.js:28 4444444444444444444444 auth wrapper before createAuth0Client()
authorize:1 Failed to load resource: the server responded with a status of 400 ()
If I clear the cookies, then the login works again. There seems to be something in the processing when there are cookies that causes things to hang.
I really appreciate the help - this seems like a really great product and I can see myself using this for many projects - I just need to learn how it works and what I might be doing wrong.
from auth0-spa-js.
@gurneyds Can you inspect your tenant logs? If there's any misconfiguration, it will probably show up there.
from auth0-spa-js.
@gurneyds I looked at your client configuration and I believe you have a typo in the ‘Allowed Web Origins’ fields. It should be http://localhost:3000
and not http://localhost:3000/
from auth0-spa-js.
Yes indeed - thank you! The error messages are now gone. I would still expect the authentication to be valid when I refresh the page. After a successful login, the page works fine until I refresh the page. Refreshing the page causes several of the cookies to go away and the page is no longer authenticated. I am forced to authenticate again with each page refresh. Maybe I have another configuration problem?
from auth0-spa-js.
@gurneyds If you check your tenant logs again, you'll see a warning about development keys.
from auth0-spa-js.
I'll close this in favor of #99 because #99 has a repro project that I can test.
from auth0-spa-js.
Related Issues (20)
- "Misconfiguration in the system or a service outage" error in Auth0 HOT 3
- prompt in authorizationParams is not getting override. It is coming none even if it is set to other value like login. HOT 7
- Sophos Cyber Security Endpoint detects ransomware in the package HOT 3
- Total Cookie Protection breaks auth HOT 2
- Better error messaging when out of local storage quota? HOT 4
- Angular SSR window.crypto HOT 1
- User without Organization Membership caused infitine login redirect loop HOT 2
- NullInjectorError HOT 1
- Use '.well-known/openid-configuration' to configure Auth0Provider (Auth0Client) calls HOT 6
- Clarify limits for checkSession method HOT 7
- React Quickstart causing error upon clicking the login button HOT 2
- organization option of Auth0Client.getTokenSilently function is unexpectedly reuse previous value HOT 4
- Make getTokenSilently Generic HOT 2
- Support `getAccessTokenSilently` for multiple audiences in parallel HOT 4
- auth0-spa-js for multipage app? HOT 3
- Suport for multi tab sessions HOT 5
- Add configuration option for custom transaction storage
- LoginWithPopup doesn't work in Microsoft Word add-in on Mac HOT 3
- Extra redirect on silent login after upgrade to v2 HOT 9
- Implicit return in auth0-spa-js/src/cache /cache-manager.ts when TS "noImplicitReturns" is set to true HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auth0-spa-js.