Skip to content

Commit f18b8e7

Browse files
GiteaBotZettat123
andauthored
Change default email domain for LDAP users (#25425) (#25434)
Backport #25425 by @Zettat123 Fixes #21169 Change `localhost` to `localhost.local` Co-authored-by: Zettat123 <[email protected]>
1 parent ea00ed3 commit f18b8e7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

services/auth/source/ldap/source_authenticate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (source *Source) Authenticate(user *user_model.User, userName, password str
7676
}
7777

7878
if len(sr.Mail) == 0 {
79-
sr.Mail = fmt.Sprintf("%s@localhost", sr.Username)
79+
sr.Mail = fmt.Sprintf("%s@localhost.local", sr.Username)
8080
}
8181

8282
user = &user_model.User{

services/auth/source/ldap/source_sync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (source *Source) Sync(ctx context.Context, updateExisting bool) error {
104104
}
105105

106106
if len(su.Mail) == 0 {
107-
su.Mail = fmt.Sprintf("%s@localhost", su.Username)
107+
su.Mail = fmt.Sprintf("%s@localhost.local", su.Username)
108108
}
109109

110110
fullName := composeFullName(su.Name, su.Surname, su.Username)

0 commit comments

Comments
 (0)