Closed MikaStark closed 1 week ago
The window.location.origin is something that works in a lot of situations and is what we add to our quickstart, you are free to change it to whatever you like.
I don't think baseURI is commonly known or used, and it may confused more people (and I have not tried if it works in as many use-cases as window.location.origin).
You can use any URL that works for you.
It’s unfortunate I didn’t convince you, as document.baseURI is massively supported and using it cover the same use-cases as window.location.origin and more (as I guess, the first use the later).
Checklist
Describe the problem you'd like to have solved
Hi!
I recently deployed an Angular app using this package on a shared HTTP server, which requires hosting the app in a subfolder (e.g., https://www.mysite.fr/foo/). To accommodate this, I adjusted the base href during build time (ng build --base-href /foo/).
Following the Auth0 Angular quickstart, I noticed that you recommend using window.location.origin as the redirect_uri. However, I was surprised by this suggestion because document.baseURI accounts for the base href, while window.location.origin does not.
Could you clarify why window.location.origin is recommended over document.baseURI?
Describe the ideal solution
Update Auth0 Angular quickstart by replacing the code example by this :
Also update Add logout to your application example the same way :
Alternatives and current workarounds
No response
Additional context
I found this related topic but the proposed solution is partial and seems overcomplicated to me (using
LocationStrategy
)