mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
FIX: only override sso name / username if it is supplied
This commit is contained in:
parent
73624e63c5
commit
6451495ec6
@ -114,12 +114,11 @@ class DiscourseSingleSignOn < SingleSignOn
|
||||
user.email = email
|
||||
end
|
||||
|
||||
if SiteSetting.sso_overrides_username &&
|
||||
user.username != username
|
||||
if SiteSetting.sso_overrides_username && user.username != username && username.present?
|
||||
user.username = UserNameSuggester.suggest(username || name || email, user.username)
|
||||
end
|
||||
|
||||
if SiteSetting.sso_overrides_name && user.name != name
|
||||
if SiteSetting.sso_overrides_name && user.name != name && name.present?
|
||||
user.name = name || User.suggest_name(username.blank? ? email : username)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user