feat: add passkey_enrolled and mfa_method_preference to Custom JWT claims
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -553,10 +553,13 @@ CUSTOM_JWT_SCRIPT='const getCustomJwtClaims = async ({ token, context, environme
|
||||
}
|
||||
}
|
||||
const mfaFactors = context?.user?.mfaVerificationFactors || [];
|
||||
const mfaEnrolled = mfaFactors.some(f => f.type === "Totp");
|
||||
const mfaEnrolled = mfaFactors.some(f => f.type === "Totp" || f.type === "WebAuthn");
|
||||
const passkeyEnrolled = mfaFactors.some(f => f.type === "WebAuthn");
|
||||
const claims = {};
|
||||
if (roles.size > 0) claims.roles = [...roles];
|
||||
claims.mfa_enrolled = mfaEnrolled;
|
||||
claims.passkey_enrolled = passkeyEnrolled;
|
||||
claims.mfa_method_preference = context?.user?.customData?.mfa_method_preference || null;
|
||||
return claims;
|
||||
};'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user