-
Notifications
You must be signed in to change notification settings - Fork 153
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
Fix the OIDC login button when using a RoutePrefix. #4022
Conversation
231cc8f
to
a68b109
Compare
@@ -92,7 +92,7 @@ function SignIn({ darkModeEnabled = true }: Props) { | |||
|
|||
const handleOIDCSubmit = () => { | |||
const CURRENT_URL = window.origin; | |||
return (window.location.href = `/oauth2?return_url=${encodeURIComponent( | |||
return (window.location.href = `./oauth2?return_url=${encodeURIComponent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work. Which makes sense, but I thought I read something to the contrary recently -- that while a
, img
, script
etc tags respect base
tags, the JS world (e.g. setting location.href
) does not.
However after doing some more testing it seems that it does, and this works fine, even if you end up at localhost:9001/wego/signin/ (with a trailing slash), which still routes correctly, and then logs into OIDC correctly too..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSDOM etc at least don't support navigation so this is a trickier case to test w/out more involved acceptance tests..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Make the OIDC login button relative so that it uses the route Prefix from the base.
1552dda
to
809c7e3
Compare
Closes #4016
What changed?
Make the OIDC login button relative so that it uses the route prefix from the HTML base element.
Why was this change made?
To address a bug when logging in with OIDC and a Route Prefix.
How was this change implemented?
Tests.
How did you validate the change?
Setup a login via Dex and it now goes to the correct URL.
Release notes
Allow use of the route prefix mechanism with OIDC authentication.
Documentation Changes