test(auth): cover OIDC profile verification wiring

This commit is contained in:
ajnart committed 2026-07-22 23:08:36 +02:00
1 parent 181850f77f
commit 4547fb2f79
2 files changed
+79 -12

No files matched your search

@@ -1,8 +1,11 @@
export const assertVerifiedEmailForCredentialsLinking = (
profile: { email_verified?: unknown },
profile: { email?: unknown; email_verified?: unknown },
isCredentialsLinkingEnabled: boolean,
) => {
if (isCredentialsLinkingEnabled && profile.email_verified !== true) {
if (
isCredentialsLinkingEnabled &&
(profile.email_verified !== true || typeof profile.email !== "string" || profile.email.trim().length === 0)
) {
throw new Error("OIDC provider did not return a verified email while credentials linking is enabled");
}
};