aboutsummaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/auth/signin.go3
-rw-r--r--services/auth/source/pam/source_authenticate.go5
-rw-r--r--services/mailer/mail.go3
3 files changed, 7 insertions, 4 deletions
diff --git a/services/auth/signin.go b/services/auth/signin.go
index a7ad029456..5477e8643e 100644
--- a/services/auth/signin.go
+++ b/services/auth/signin.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/login"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
// Register the sources
@@ -32,7 +33,7 @@ func UserSignIn(username, password string) (*models.User, *login.Source, error)
return nil, nil, err
}
if cnt > 1 {
- return nil, nil, models.ErrEmailAlreadyUsed{
+ return nil, nil, user_model.ErrEmailAlreadyUsed{
Email: user.Email,
}
}
diff --git a/services/auth/source/pam/source_authenticate.go b/services/auth/source/pam/source_authenticate.go
index cb5ffc2861..6998241ad7 100644
--- a/services/auth/source/pam/source_authenticate.go
+++ b/services/auth/source/pam/source_authenticate.go
@@ -10,6 +10,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/login"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/auth/pam"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/mailer"
@@ -39,13 +40,13 @@ func (source *Source) Authenticate(user *models.User, userName, password string)
if idx > -1 {
username = pamLogin[:idx]
}
- if models.ValidateEmail(email) != nil {
+ if user_model.ValidateEmail(email) != nil {
if source.EmailDomain != "" {
email = fmt.Sprintf("%s@%s", username, source.EmailDomain)
} else {
email = fmt.Sprintf("%s@%s", username, setting.Service.NoReplyAddress)
}
- if models.ValidateEmail(email) != nil {
+ if user_model.ValidateEmail(email) != nil {
email = uuid.New().String() + "@localhost"
}
}
diff --git a/services/mailer/mail.go b/services/mailer/mail.go
index bd8f059c5e..b579bf383a 100644
--- a/services/mailer/mail.go
+++ b/services/mailer/mail.go
@@ -16,6 +16,7 @@ import (
texttmpl "text/template"
"code.gitea.io/gitea/models"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/emoji"
"code.gitea.io/gitea/modules/log"
@@ -112,7 +113,7 @@ func SendResetPasswordMail(u *models.User) {
}
// SendActivateEmailMail sends confirmation email to confirm new email address
-func SendActivateEmailMail(u *models.User, email *models.EmailAddress) {
+func SendActivateEmailMail(u *models.User, email *user_model.EmailAddress) {
if setting.MailService == nil {
// No mail service configured
return