aboutsummaryrefslogtreecommitdiffstats
path: root/services/auth/source/smtp/source_authenticate.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth/source/smtp/source_authenticate.go')
-rw-r--r--services/auth/source/smtp/source_authenticate.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/services/auth/source/smtp/source_authenticate.go b/services/auth/source/smtp/source_authenticate.go
index e3dcd83222..cff64c69d2 100644
--- a/services/auth/source/smtp/source_authenticate.go
+++ b/services/auth/source/smtp/source_authenticate.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/util"
+ "code.gitea.io/gitea/services/mailer"
)
// Authenticate queries if the provided login/password is authenticates against the SMTP server
@@ -74,5 +75,12 @@ func (source *Source) Authenticate(user *models.User, login, password string) (*
LoginName: login,
IsActive: true,
}
- return user, models.CreateUser(user)
+
+ if err := models.CreateUser(user); err != nil {
+ return user, err
+ }
+
+ mailer.SendRegisterNotifyMail(user)
+
+ return user, nil
}