diff options
Diffstat (limited to 'services/auth/source/pam/source_authenticate.go')
-rw-r--r-- | services/auth/source/pam/source_authenticate.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/auth/source/pam/source_authenticate.go b/services/auth/source/pam/source_authenticate.go index 6ca0642904..8241aed725 100644 --- a/services/auth/source/pam/source_authenticate.go +++ b/services/auth/source/pam/source_authenticate.go @@ -11,6 +11,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth/pam" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/services/mailer" "github.com/google/uuid" ) @@ -58,5 +59,12 @@ func (source *Source) Authenticate(user *models.User, login, password string) (* LoginName: login, // This is what the user typed in IsActive: true, } - return user, models.CreateUser(user) + + if err := models.CreateUser(user); err != nil { + return user, err + } + + mailer.SendRegisterNotifyMail(user) + + return user, nil } |