fix(auth): 注册唯一性检查识别 Gmail 邮箱别名

合并 #681:注册唯一性检查识别 Gmail 邮箱别名
This commit is contained in:
Catlaxy AI authored and GitHub committed 2026-10-06 09:23:04 +08:00
1 parent a71e03b131
commit 19841cb9c5
12 files changed
+316 -8

No files matched your search

+1 -3
View File
@@ -168,9 +168,7 @@ func (s *Service) SendRegistrationEmailCode(rawEmail string) error {
if !registrationEnabled {
return kernel.Forbidden("管理员未开放新用户注册")
}
if _, err := s.repo.UserByEmail(email); err == nil {
return kernel.BadAuthRequest("邮箱已被注册")
} else if !errors.Is(err, gorm.ErrRecordNotFound) {
if err := s.repo.CheckEmailAvailable(email, ""); err != nil {
return err
}
_, setting, err := s.readEmailSetting()