fdundjer
08/25/2023, 11:40 AMsuper({
key: "st-ev",
async fetchValue(userId, _, userContext) {
const recipe = EmailVerificationRecipe.getInstanceOrThrowError();
let emailInfo = await recipe.getEmailForUserId(userId, userContext);
if (emailInfo.status === "OK") {
return recipe.recipeInterfaceImpl.isEmailVerified({ userId, email: emailInfo.email, userContext });
} else if (emailInfo.status === "EMAIL_DOES_NOT_EXIST_ERROR") {
// We consider people without email addresses as validated
return true;
} else {
throw new Error("UNKNOWN_USER_ID");
}
},
defaultMaxAgeInSeconds: 300,
});