feat: fix bugs in custom app sso login with WebAuthn authentication (#2457)

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
This commit is contained in:
aiden 2023-10-29 21:54:34 -05:00 committed by GitHub
parent b320cca789
commit 34b1945180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -766,7 +766,11 @@ class LoginPage extends React.Component {
const rawId = assertion.rawId; const rawId = assertion.rawId;
const sig = assertion.response.signature; const sig = assertion.response.signature;
const userHandle = assertion.response.userHandle; const userHandle = assertion.response.userHandle;
return fetch(`${Setting.ServerUrl}/api/webauthn/signin/finish?responseType=${values["type"]}`, { let finishUrl = `${Setting.ServerUrl}/api/webauthn/signin/finish?responseType=${values["type"]}`;
if (values["type"] === "code") {
finishUrl = `${Setting.ServerUrl}/api/webauthn/signin/finish?responseType=${values["type"]}&clientId=${oAuthParams.clientId}&scope=${oAuthParams.scope}&redirectUri=${oAuthParams.redirectUri}&nonce=${oAuthParams.nonce}&state=${oAuthParams.state}&codeChallenge=${oAuthParams.codeChallenge}&challengeMethod=${oAuthParams.challengeMethod}`;
}
return fetch(finishUrl, {
method: "POST", method: "POST",
credentials: "include", credentials: "include",
body: JSON.stringify({ body: JSON.stringify({