mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -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
|
user.email = email
|
||||||
end
|
end
|
||||||
|
|
||||||
if SiteSetting.sso_overrides_username &&
|
if SiteSetting.sso_overrides_username && user.username != username && username.present?
|
||||||
user.username != username
|
|
||||||
user.username = UserNameSuggester.suggest(username || name || email, user.username)
|
user.username = UserNameSuggester.suggest(username || name || email, user.username)
|
||||||
end
|
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)
|
user.name = name || User.suggest_name(username.blank? ? email : username)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user