From c6ba133ad901675bff7e649b870b703a5c262307 Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Tue, 19 Mar 2024 00:34:06 +0530 Subject: [PATCH] fixes snippet and updates depedency versions --- .../email-verification/protecting-routes.mdx | 12 ++++++------ .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- .../custom-ui/enable-email-verification.mdx | 6 +++--- .../pre-built-ui/enable-email-verification.mdx | 4 ++-- v2/emailpassword/user-roles/protecting-routes.mdx | 6 +++--- v2/mfa/protect-routes.mdx | 6 +++--- .../email-verification/protecting-routes.mdx | 12 ++++++------ .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- .../custom-ui/enable-email-verification.mdx | 6 +++--- .../pre-built-ui/enable-email-verification.mdx | 4 ++-- v2/passwordless/user-roles/protecting-routes.mdx | 6 +++--- .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- v2/src/plugins/codeTypeChecking/jsEnv/package.json | 10 +++++----- .../email-verification/protecting-routes.mdx | 12 ++++++------ .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- .../custom-ui/enable-email-verification.mdx | 6 +++--- .../pre-built-ui/enable-email-verification.mdx | 4 ++-- v2/thirdparty/user-roles/protecting-routes.mdx | 6 +++--- .../email-verification/protecting-routes.mdx | 12 ++++++------ .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- .../custom-ui/enable-email-verification.mdx | 6 +++--- .../pre-built-ui/enable-email-verification.mdx | 4 ++-- .../user-roles/protecting-routes.mdx | 6 +++--- .../email-verification/protecting-routes.mdx | 12 ++++++------ .../sessions/claims/claim-validators.mdx | 14 +++++++------- .../sessions/protecting-frontend-routes.mdx | 6 +++--- .../custom-ui/enable-email-verification.mdx | 6 +++--- .../pre-built-ui/enable-email-verification.mdx | 4 ++-- .../user-roles/protecting-routes.mdx | 6 +++--- v2/userroles/protecting-routes.mdx | 6 +++--- 35 files changed, 141 insertions(+), 141 deletions(-) diff --git a/v2/emailpassword/common-customizations/email-verification/protecting-routes.mdx b/v2/emailpassword/common-customizations/email-verification/protecting-routes.mdx index c5f348331..d7d7a5ca0 100644 --- a/v2/emailpassword/common-customizations/email-verification/protecting-routes.mdx +++ b/v2/emailpassword/common-customizations/email-verification/protecting-routes.mdx @@ -1061,7 +1061,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -1126,7 +1126,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -1151,7 +1151,7 @@ async function shouldLoadRoute() { let validationErrors = await Session.validateClaims(/*{...}*/); // highlight-start for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed } else { // some other claim check failed (from the global validators list) @@ -1224,7 +1224,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1276,7 +1276,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1340,7 +1340,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the previous section to send the verification email. // await sendEmail(); diff --git a/v2/emailpassword/common-customizations/sessions/claims/claim-validators.mdx b/v2/emailpassword/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/emailpassword/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/emailpassword/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/emailpassword/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/emailpassword/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/emailpassword/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/emailpassword/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/emailpassword/custom-ui/enable-email-verification.mdx b/v2/emailpassword/custom-ui/enable-email-verification.mdx index c8ee612cf..369a61adc 100644 --- a/v2/emailpassword/custom-ui/enable-email-verification.mdx +++ b/v2/emailpassword/custom-ui/enable-email-verification.mdx @@ -665,7 +665,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -693,7 +693,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified } } @@ -729,7 +729,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the next section to send the verification email. // await sendEmail(); diff --git a/v2/emailpassword/pre-built-ui/enable-email-verification.mdx b/v2/emailpassword/pre-built-ui/enable-email-verification.mdx index 916b4cfec..8e9844e18 100644 --- a/v2/emailpassword/pre-built-ui/enable-email-verification.mdx +++ b/v2/emailpassword/pre-built-ui/enable-email-verification.mdx @@ -705,7 +705,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -745,7 +745,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } diff --git a/v2/emailpassword/user-roles/protecting-routes.mdx b/v2/emailpassword/user-roles/protecting-routes.mdx index c71694b2a..b3ea9478d 100644 --- a/v2/emailpassword/user-roles/protecting-routes.mdx +++ b/v2/emailpassword/user-roles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/mfa/protect-routes.mdx b/v2/mfa/protect-routes.mdx index 565704585..048bf0b5f 100644 --- a/v2/mfa/protect-routes.mdx +++ b/v2/mfa/protect-routes.mdx @@ -871,7 +871,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === MultiFactorAuthClaim.id) { + if (err.id === MultiFactorAuthClaim.id) { // user has not finished MFA factors. let mfaClaimValue = await Session.getClaimValue({ claim: MultiFactorAuthClaim @@ -931,7 +931,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === MultiFactorAuthClaim.id) { + if (err.id === MultiFactorAuthClaim.id) { // user has not finished MFA factors. let mfaClaimValue = await Session.getClaimValue({ claim: MultiFactorAuthClaim @@ -964,7 +964,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensMultiFactorAuth.MultiFactorAuthClaim.id) { + if (err.id === supertokensMultiFactorAuth.MultiFactorAuthClaim.id) { // user has not finished MFA factors. let mfaClaimValue = await supertokensSession.getClaimValue({ claim: supertokensMultiFactorAuth.MultiFactorAuthClaim diff --git a/v2/passwordless/common-customizations/email-verification/protecting-routes.mdx b/v2/passwordless/common-customizations/email-verification/protecting-routes.mdx index c5f348331..d7d7a5ca0 100644 --- a/v2/passwordless/common-customizations/email-verification/protecting-routes.mdx +++ b/v2/passwordless/common-customizations/email-verification/protecting-routes.mdx @@ -1061,7 +1061,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -1126,7 +1126,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -1151,7 +1151,7 @@ async function shouldLoadRoute() { let validationErrors = await Session.validateClaims(/*{...}*/); // highlight-start for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed } else { // some other claim check failed (from the global validators list) @@ -1224,7 +1224,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1276,7 +1276,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1340,7 +1340,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the previous section to send the verification email. // await sendEmail(); diff --git a/v2/passwordless/common-customizations/sessions/claims/claim-validators.mdx b/v2/passwordless/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/passwordless/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/passwordless/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/passwordless/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/passwordless/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/passwordless/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/passwordless/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/passwordless/custom-ui/enable-email-verification.mdx b/v2/passwordless/custom-ui/enable-email-verification.mdx index d4eeecb27..141fd9383 100644 --- a/v2/passwordless/custom-ui/enable-email-verification.mdx +++ b/v2/passwordless/custom-ui/enable-email-verification.mdx @@ -669,7 +669,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -697,7 +697,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified } } @@ -733,7 +733,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the next section to send the verification email. // await sendEmail(); diff --git a/v2/passwordless/pre-built-ui/enable-email-verification.mdx b/v2/passwordless/pre-built-ui/enable-email-verification.mdx index 82be9d23e..365a94e1d 100644 --- a/v2/passwordless/pre-built-ui/enable-email-verification.mdx +++ b/v2/passwordless/pre-built-ui/enable-email-verification.mdx @@ -709,7 +709,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -749,7 +749,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } diff --git a/v2/passwordless/user-roles/protecting-routes.mdx b/v2/passwordless/user-roles/protecting-routes.mdx index c71694b2a..b3ea9478d 100644 --- a/v2/passwordless/user-roles/protecting-routes.mdx +++ b/v2/passwordless/user-roles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/session/common-customizations/sessions/claims/claim-validators.mdx b/v2/session/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/session/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/session/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/session/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/session/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/session/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/session/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/src/plugins/codeTypeChecking/jsEnv/package.json b/v2/src/plugins/codeTypeChecking/jsEnv/package.json index 6f4760c7d..2eb1c82cd 100644 --- a/v2/src/plugins/codeTypeChecking/jsEnv/package.json +++ b/v2/src/plugins/codeTypeChecking/jsEnv/package.json @@ -55,14 +55,14 @@ "react-router-dom5": "npm:react-router-dom@^5.3.0", "socket.io": "^4.6.1", "socketio": "^1.0.0", - "supertokens-auth-react": "github:supertokens/supertokens-auth-react#0.39", - "supertokens-node": "github:supertokens/supertokens-node#17.0", + "supertokens-auth-react": "^0.39.0", + "supertokens-node": "^17.0.0", "supertokens-node7": "npm:supertokens-node@7.3", "supertokens-react-native": "^4.0.0", - "supertokens-web-js": "github:supertokens/supertokens-web-js#0.10", + "supertokens-web-js": "^0.10.0", "supertokens-web-js-script": "github:supertokens/supertokens-web-js#0.10", - "supertokens-website": "^17.0.0", - "supertokens-website-script": "github:supertokens/supertokens-website#17.0", + "supertokens-website": "^19.0.0", + "supertokens-website-script": "github:supertokens/supertokens-website#19.0", "typescript": "^4.9.5" } } \ No newline at end of file diff --git a/v2/thirdparty/common-customizations/email-verification/protecting-routes.mdx b/v2/thirdparty/common-customizations/email-verification/protecting-routes.mdx index c5f348331..d7d7a5ca0 100644 --- a/v2/thirdparty/common-customizations/email-verification/protecting-routes.mdx +++ b/v2/thirdparty/common-customizations/email-verification/protecting-routes.mdx @@ -1061,7 +1061,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -1126,7 +1126,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -1151,7 +1151,7 @@ async function shouldLoadRoute() { let validationErrors = await Session.validateClaims(/*{...}*/); // highlight-start for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed } else { // some other claim check failed (from the global validators list) @@ -1224,7 +1224,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1276,7 +1276,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1340,7 +1340,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the previous section to send the verification email. // await sendEmail(); diff --git a/v2/thirdparty/common-customizations/sessions/claims/claim-validators.mdx b/v2/thirdparty/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/thirdparty/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/thirdparty/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/thirdparty/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/thirdparty/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/thirdparty/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/thirdparty/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/thirdparty/custom-ui/enable-email-verification.mdx b/v2/thirdparty/custom-ui/enable-email-verification.mdx index 93743bea2..f532b96b6 100644 --- a/v2/thirdparty/custom-ui/enable-email-verification.mdx +++ b/v2/thirdparty/custom-ui/enable-email-verification.mdx @@ -669,7 +669,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -697,7 +697,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified } } @@ -733,7 +733,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the next section to send the verification email. // await sendEmail(); diff --git a/v2/thirdparty/pre-built-ui/enable-email-verification.mdx b/v2/thirdparty/pre-built-ui/enable-email-verification.mdx index 44921ed07..50cce6105 100644 --- a/v2/thirdparty/pre-built-ui/enable-email-verification.mdx +++ b/v2/thirdparty/pre-built-ui/enable-email-verification.mdx @@ -709,7 +709,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -749,7 +749,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } diff --git a/v2/thirdparty/user-roles/protecting-routes.mdx b/v2/thirdparty/user-roles/protecting-routes.mdx index c71694b2a..b3ea9478d 100644 --- a/v2/thirdparty/user-roles/protecting-routes.mdx +++ b/v2/thirdparty/user-roles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/thirdpartyemailpassword/common-customizations/email-verification/protecting-routes.mdx b/v2/thirdpartyemailpassword/common-customizations/email-verification/protecting-routes.mdx index c5f348331..d7d7a5ca0 100644 --- a/v2/thirdpartyemailpassword/common-customizations/email-verification/protecting-routes.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/email-verification/protecting-routes.mdx @@ -1061,7 +1061,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -1126,7 +1126,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -1151,7 +1151,7 @@ async function shouldLoadRoute() { let validationErrors = await Session.validateClaims(/*{...}*/); // highlight-start for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed } else { // some other claim check failed (from the global validators list) @@ -1224,7 +1224,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1276,7 +1276,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1340,7 +1340,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the previous section to send the verification email. // await sendEmail(); diff --git a/v2/thirdpartyemailpassword/common-customizations/sessions/claims/claim-validators.mdx b/v2/thirdpartyemailpassword/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/thirdpartyemailpassword/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/thirdpartyemailpassword/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/thirdpartyemailpassword/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/thirdpartyemailpassword/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/thirdpartyemailpassword/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/thirdpartyemailpassword/custom-ui/enable-email-verification.mdx b/v2/thirdpartyemailpassword/custom-ui/enable-email-verification.mdx index 93743bea2..f532b96b6 100644 --- a/v2/thirdpartyemailpassword/custom-ui/enable-email-verification.mdx +++ b/v2/thirdpartyemailpassword/custom-ui/enable-email-verification.mdx @@ -669,7 +669,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -697,7 +697,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified } } @@ -733,7 +733,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the next section to send the verification email. // await sendEmail(); diff --git a/v2/thirdpartyemailpassword/pre-built-ui/enable-email-verification.mdx b/v2/thirdpartyemailpassword/pre-built-ui/enable-email-verification.mdx index 44921ed07..50cce6105 100644 --- a/v2/thirdpartyemailpassword/pre-built-ui/enable-email-verification.mdx +++ b/v2/thirdpartyemailpassword/pre-built-ui/enable-email-verification.mdx @@ -709,7 +709,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -749,7 +749,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } diff --git a/v2/thirdpartyemailpassword/user-roles/protecting-routes.mdx b/v2/thirdpartyemailpassword/user-roles/protecting-routes.mdx index c71694b2a..b3ea9478d 100644 --- a/v2/thirdpartyemailpassword/user-roles/protecting-routes.mdx +++ b/v2/thirdpartyemailpassword/user-roles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/thirdpartypasswordless/common-customizations/email-verification/protecting-routes.mdx b/v2/thirdpartypasswordless/common-customizations/email-verification/protecting-routes.mdx index c5f348331..d7d7a5ca0 100644 --- a/v2/thirdpartypasswordless/common-customizations/email-verification/protecting-routes.mdx +++ b/v2/thirdpartypasswordless/common-customizations/email-verification/protecting-routes.mdx @@ -1061,7 +1061,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -1126,7 +1126,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -1151,7 +1151,7 @@ async function shouldLoadRoute() { let validationErrors = await Session.validateClaims(/*{...}*/); // highlight-start for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed } else { // some other claim check failed (from the global validators list) @@ -1224,7 +1224,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1276,7 +1276,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified // Send the verification email to the user await sendEmail(); @@ -1340,7 +1340,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the previous section to send the verification email. // await sendEmail(); diff --git a/v2/thirdpartypasswordless/common-customizations/sessions/claims/claim-validators.mdx b/v2/thirdpartypasswordless/common-customizations/sessions/claims/claim-validators.mdx index 545e51ca3..8ffe6e207 100644 --- a/v2/thirdpartypasswordless/common-customizations/sessions/claims/claim-validators.mdx +++ b/v2/thirdpartypasswordless/common-customizations/sessions/claims/claim-validators.mdx @@ -911,7 +911,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -990,7 +990,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -1057,7 +1057,7 @@ async function shouldAllowAccessToProtectedPage() { // all checks passed return true; } - if (validatorFailures.some(i => i.validatorId === SecondFactorClaim.id)) { + if (validatorFailures.some(i => i.id === SecondFactorClaim.id)) { // 2fa check failed return false; } @@ -2308,7 +2308,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2395,7 +2395,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2466,7 +2466,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -2747,7 +2747,7 @@ const Dashboard = () => { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === SecondFactorClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === SecondFactorClaim.id)) { // the 2fa check failed. We should redirect the user to the second // factor screen. return "You cannot access this page because you have not completed 2FA"; diff --git a/v2/thirdpartypasswordless/common-customizations/sessions/protecting-frontend-routes.mdx b/v2/thirdpartypasswordless/common-customizations/sessions/protecting-frontend-routes.mdx index 6631e597d..e8d5f70ac 100644 --- a/v2/thirdpartypasswordless/common-customizations/sessions/protecting-frontend-routes.mdx +++ b/v2/thirdpartypasswordless/common-customizations/sessions/protecting-frontend-routes.mdx @@ -233,7 +233,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -456,7 +456,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -527,7 +527,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/thirdpartypasswordless/custom-ui/enable-email-verification.mdx b/v2/thirdpartypasswordless/custom-ui/enable-email-verification.mdx index 29ef5c964..0e01e4d10 100644 --- a/v2/thirdpartypasswordless/custom-ui/enable-email-verification.mdx +++ b/v2/thirdpartypasswordless/custom-ui/enable-email-verification.mdx @@ -670,7 +670,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } @@ -698,7 +698,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === supertokensEmailVerification.EmailVerificationClaim.id) { + if (err.id === supertokensEmailVerification.EmailVerificationClaim.id) { // email is not verified } } @@ -734,7 +734,7 @@ async function callProtectedRoute() { if (axios.isAxiosError(error) && error.response?.status === 403) { let validationErrors = await Session.validateClaims(); for (let err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email verification claim check failed // We call the sendEmail function defined in the next section to send the verification email. // await sendEmail(); diff --git a/v2/thirdpartypasswordless/pre-built-ui/enable-email-verification.mdx b/v2/thirdpartypasswordless/pre-built-ui/enable-email-verification.mdx index 364529f98..2282c4cd6 100644 --- a/v2/thirdpartypasswordless/pre-built-ui/enable-email-verification.mdx +++ b/v2/thirdpartypasswordless/pre-built-ui/enable-email-verification.mdx @@ -710,7 +710,7 @@ function InvalidClaimHandler(props: React.PropsWithChildren) { return null; } - if (sessionContext.invalidClaims.some(i => i.validatorId === EmailVerificationClaim.id)) { + if (sessionContext.invalidClaims.some(i => i.id === EmailVerificationClaim.id)) { // Alternatively you could redirect the user to the email verification screen to trigger the verification email // Note: /auth/verify-email is the default email verification path // window.location.assign("/auth/verify-email") @@ -750,7 +750,7 @@ async function shouldLoadRoute(): Promise { return true; } else { for (const err of validationErrors) { - if (err.validatorId === EmailVerificationClaim.id) { + if (err.id === EmailVerificationClaim.id) { // email is not verified } } diff --git a/v2/thirdpartypasswordless/user-roles/protecting-routes.mdx b/v2/thirdpartypasswordless/user-roles/protecting-routes.mdx index c71694b2a..b3ea9478d 100644 --- a/v2/thirdpartypasswordless/user-roles/protecting-routes.mdx +++ b/v2/thirdpartypasswordless/user-roles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) diff --git a/v2/userroles/protecting-routes.mdx b/v2/userroles/protecting-routes.mdx index 2a3ea61bc..6ab9d6cfe 100644 --- a/v2/userroles/protecting-routes.mdx +++ b/v2/userroles/protecting-routes.mdx @@ -1246,7 +1246,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1326,7 +1326,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === UserRoleClaim.id) { + if (err.id === UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list) @@ -1393,7 +1393,7 @@ async function shouldLoadRoute(): Promise { } for (const err of validationErrors) { - if (err.validatorId === supertokensUserRoles.UserRoleClaim.id) { + if (err.id === supertokensUserRoles.UserRoleClaim.id) { // user roles claim check failed } else { // some other claim check failed (from the global validators list)