fix: hash in callback url is incorrectly appended

This commit is contained in:
Elias Schneider
2025-01-01 22:46:59 +01:00
parent 993330d932
commit f6f2736bba

View File

@@ -55,7 +55,14 @@
isLoading = true; isLoading = true;
try { try {
await oidService await oidService
.authorizeNewClient(client!.id, scope, callbackURL, nonce, codeChallenge, codeChallengeMethod) .authorizeNewClient(
client!.id,
scope,
callbackURL,
nonce,
codeChallenge,
codeChallengeMethod
)
.then(async ({ code, callbackURL }) => { .then(async ({ code, callbackURL }) => {
onSuccess(code, callbackURL); onSuccess(code, callbackURL);
}); });
@@ -68,7 +75,11 @@
function onSuccess(code: string, callbackURL: string) { function onSuccess(code: string, callbackURL: string) {
success = true; success = true;
setTimeout(() => { setTimeout(() => {
window.location.href = `${callbackURL}?code=${code}&state=${state}`; const redirectURL = new URL(callbackURL);
redirectURL.searchParams.append('code', code);
redirectURL.searchParams.append('state', state);
window.location.href = redirectURL.toString();
}, 1000); }, 1000);
} }
</script> </script>