summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-22 06:53:15 -0400
committerGitHub <noreply@github.com>2023-06-22 10:53:15 +0000
commitf18b8e7d8a6f4544b263b7e32aecf7d939756626 (patch)
treecd9b6e2818e19fed014449379a4cc428768888c1 /services
parentea00ed320d97e199dba540815a5958ecea6fa162 (diff)
downloadgitea-f18b8e7d8a6f4544b263b7e32aecf7d939756626.tar.gz
gitea-f18b8e7d8a6f4544b263b7e32aecf7d939756626.zip
Change default email domain for LDAP users (#25425) (#25434)
Backport #25425 by @Zettat123 Fixes #21169 Change `localhost` to `localhost.local` Co-authored-by: Zettat123 <zettat123@gmail.com>
Diffstat (limited to 'services')
-rw-r--r--services/auth/source/ldap/source_authenticate.go2
-rw-r--r--services/auth/source/ldap/source_sync.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/auth/source/ldap/source_authenticate.go b/services/auth/source/ldap/source_authenticate.go
index 89e99b5e60..3f3219adb9 100644
--- a/services/auth/source/ldap/source_authenticate.go
+++ b/services/auth/source/ldap/source_authenticate.go
@@ -76,7 +76,7 @@ func (source *Source) Authenticate(user *user_model.User, userName, password str
}
if len(sr.Mail) == 0 {
- sr.Mail = fmt.Sprintf("%s@localhost", sr.Username)
+ sr.Mail = fmt.Sprintf("%s@localhost.local", sr.Username)
}
user = &user_model.User{
diff --git a/services/auth/source/ldap/source_sync.go b/services/auth/source/ldap/source_sync.go
index 3e0f47a37e..43ee32c84b 100644
--- a/services/auth/source/ldap/source_sync.go
+++ b/services/auth/source/ldap/source_sync.go
@@ -104,7 +104,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
}
if len(su.Mail) == 0 {
- su.Mail = fmt.Sprintf("%s@localhost", su.Username)
+ su.Mail = fmt.Sprintf("%s@localhost.local", su.Username)
}
fullName := composeFullName(su.Name, su.Surname, su.Username)