fix: disable emails for platform (#15089)
* disable emails for platform * check for if user is platform and skip verification accordingly * skip isPlatform check for verify email in create org handler * use if instead of && --------- Co-authored-by: Morgan <[email protected]>
This commit is contained in:
1 parent
e723b989a8
commit
a559daa076
2 files changed
+34
-22
No files matched your search
@@ -20,6 +20,7 @@ interface VerifyEmailType {
|
||||
email: string;
|
||||
language?: string;
|
||||
secondaryEmailId?: number;
|
||||
isPlatform?: boolean;
|
||||
}
|
||||
|
||||
export const sendEmailVerification = async ({
|
||||
@@ -27,6 +28,7 @@ export const sendEmailVerification = async ({
|
||||
language,
|
||||
username,
|
||||
secondaryEmailId,
|
||||
isPlatform = false,
|
||||
}: VerifyEmailType) => {
|
||||
const token = randomBytes(32).toString("hex");
|
||||
const translation = await getTranslation(language ?? "en", "common");
|
||||
@@ -37,6 +39,11 @@ export const sendEmailVerification = async ({
|
||||
return { ok: true, skipped: true };
|
||||
}
|
||||
|
||||
if (isPlatform) {
|
||||
log.warn("Skipping Email verification");
|
||||
return { ok: true, skipped: true };
|
||||
}
|
||||
|
||||
await checkRateLimitAndThrowError({
|
||||
rateLimitingType: "core",
|
||||
identifier: email,
|
||||
|
||||
Reference in new issue
Block a user