mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 18:58:10 +00:00
FIX: my sso_overrides_username assumed username was passed
This commit is contained in:
parent
6b13fbccc2
commit
1b5549df58
@ -181,10 +181,10 @@ class DiscourseSingleSignOn < SingleSignOn
|
||||
user.active = false if require_activation
|
||||
end
|
||||
|
||||
if SiteSetting.sso_overrides_username?
|
||||
if SiteSetting.sso_overrides_username? && username.present?
|
||||
if user.username.downcase == username.downcase
|
||||
user.username = username # there may be a change of case
|
||||
elsif user.username != username && username.present?
|
||||
elsif user.username != username
|
||||
user.username = UserNameSuggester.suggest(username || name || email, user.username)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user