linking failed page

This commit is contained in:
Max Peintner
2024-12-20 12:08:02 +01:00
parent 3887e26896
commit 09dbaf4106
9 changed files with 39 additions and 8 deletions

View File

@@ -159,6 +159,29 @@ export default async function Page(props: {
const providerType = idpTypeToIdentityProviderType(idp.type);
if (link && options?.isLinkingAllowed) {
console.log(userId);
const idpLink = await addIDPLink(
{
id: idpInformation.idpId,
userId: idpInformation.userId,
userName: idpInformation.userName,
},
userId,
);
if (!idpLink) {
return linkingFailed(branding);
} else {
return linkingSuccess(
userId,
{ idpIntentId: id, idpIntentToken: token },
authRequestId,
branding,
);
}
}
// search for potential user via username, then link
if (options?.isLinkingAllowed) {
let foundUser;