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

+6
View File
@@ -50,6 +50,12 @@ func (r *Repository) ConsumeOAuthState(provider string, stateHash string) (*mode
func (r *Repository) CreateOAuthUser(user *model.User, identity *model.UserIdentity) error {
return r.db.Transaction(func(tx *gorm.DB) error {
if err := lockRegistrationEmail(tx, user.Email); err != nil {
return err
}
if err := New(tx).CheckEmailAvailable(user.Email, ""); err != nil {
return err
}
if err := tx.Create(user).Error; err != nil {
return err
}