File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,10 @@ window.fetch = async (...args) => {
2525 const urlParams = new URLSearchParams ( window . location . search ) ;
2626 const clientId = encodeURIComponent ( urlParams . get ( 'client_id' ) ) ;
2727 const redirectUri = encodeURIComponent ( urlParams . get ( 'redirect_uri' ) ) ;
28+ const baseUrl = window . location . origin ;
2829
29- window . location . href = `/auth/openid/authorize?client_id=${ clientId } &redirect_uri=${ redirectUri } ` ;
30+ const encodedUrl = encodeURIComponent ( `/auth/openid/authorize?client_id=${ clientId } &redirect_uri=${ redirectUri } &base_url=${ baseUrl } ` ) ;
31+ window . location . href = decodeURIComponent ( encodedUrl ) ;
3032 } ;
3133
3234 listNode . appendChild ( listItemNode ) ;
Original file line number Diff line number Diff line change @@ -47,8 +47,8 @@ async def get(self, request: Request) -> Response:
4747 state = secrets .token_urlsafe (24 )
4848
4949 params = request .rel_url .query
50-
51- redirect_uri = str (request . url .with_path ("/auth/openid/callback" ))
50+ base_url = params . get ( "base_url" , "" )
51+ redirect_uri = str (URL ( base_url ) .with_path ("/auth/openid/callback" ))
5252
5353 self .hass .data ["_openid_state" ][state ] = params
5454
You can’t perform that action at this time.
0 commit comments