Skip to content

Commit a55ff0d

Browse files
authored
Change default email domain for LDAP users (#25425)
Fixes #21169 Change `localhost` to `localhost.local`
1 parent 93cd579 commit a55ff0d

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)