Skip to content

Commit 29319fe

Browse files
committed
fix: uri encode baseUrl in redirect
1 parent 71cc397 commit 29319fe

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

custom_components/openid/authorize.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ function redirect_openid_login() {
5252
const urlParams = new URLSearchParams(window.location.search);
5353
const clientId = encodeURIComponent(urlParams.get('client_id'));
5454
const redirectUri = encodeURIComponent(urlParams.get('redirect_uri'));
55-
const baseUrl = window.location.origin;
55+
const baseUrl = encodeURIComponent(window.location.origin);
5656

57-
const encodedUrl = encodeURIComponent(`/auth/openid/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&base_url=${baseUrl}`);
58-
window.location.href = decodeURIComponent(encodedUrl);
57+
window.location.href = `/auth/openid/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&base_url=${baseUrl}`;
5958
}

0 commit comments

Comments
 (0)