mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
FIX: only override sso name / username if it is supplied
This commit is contained in:
parent
73624e63c5
commit
6451495ec6
1 changed files with 2 additions and 3 deletions
|
@ -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 a new issue