summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/EmailService.ts
diff options
context:
space:
mode:
author鴇峰 朔華 <160555157+sakuhanight@users.noreply.github.com>2025-02-16 18:41:33 +0900
committerGitHub <noreply@github.com>2025-02-16 09:41:33 +0000
commitf3a4434830ac4cc2d12f814f880d41ba7b81b87b (patch)
treee01470b38636bacd410b5143f5069a0e3f2be4d4 /packages/backend/src/core/EmailService.ts
parentfix(deps): update [frontend] update dependencies (#15504) (diff)
downloadsharkey-f3a4434830ac4cc2d12f814f880d41ba7b81b87b.tar.gz
sharkey-f3a4434830ac4cc2d12f814f880d41ba7b81b87b.tar.bz2
sharkey-f3a4434830ac4cc2d12f814f880d41ba7b81b87b.zip
fix(backend): メールアドレスの形式が正しくなければ以降の処理を行わないように (#15320)
* Mod: バリデーションを追加 * 条件の修正 notつけわすれ * Update CHANGELOG.md
Diffstat (limited to 'packages/backend/src/core/EmailService.ts')
-rw-r--r--packages/backend/src/core/EmailService.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/backend/src/core/EmailService.ts b/packages/backend/src/core/EmailService.ts
index da198d0e42..45d7ea11e4 100644
--- a/packages/backend/src/core/EmailService.ts
+++ b/packages/backend/src/core/EmailService.ts
@@ -164,6 +164,13 @@ export class EmailService {
available: boolean;
reason: null | 'used' | 'format' | 'disposable' | 'mx' | 'smtp' | 'banned' | 'network' | 'blacklist';
}> {
+ if (!this.utilityService.validateEmailFormat(emailAddress)) {
+ return {
+ available: false,
+ reason: 'format',
+ };
+ }
+
const exist = await this.userProfilesRepository.countBy({
emailVerified: true,
email: emailAddress,