mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 13:03:16 +08:00
FIX: stop stripping dots from SSO names
This could upset Louis C.K.
This commit is contained in:
parent
adc9e68e66
commit
05737effef
|
@ -88,7 +88,7 @@ class DiscourseSingleSignOn < SingleSignOn
|
|||
|
||||
user_params = {
|
||||
email: email,
|
||||
name: User.suggest_name(try_name || try_username || email),
|
||||
name: try_name || User.suggest_name(try_username || email),
|
||||
username: UserNameSuggester.suggest(try_username || try_name || email),
|
||||
ip_address: ip_address
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ class DiscourseSingleSignOn < SingleSignOn
|
|||
end
|
||||
|
||||
if SiteSetting.sso_overrides_name && user.name != name
|
||||
user.name = User.suggest_name(name || username || email)
|
||||
user.name = name || User.suggest_name(username || email)
|
||||
end
|
||||
|
||||
if SiteSetting.sso_overrides_avatar && avatar_url.present? && (
|
||||
|
|
|
@ -85,12 +85,15 @@ describe DiscourseSingleSignOn do
|
|||
|
||||
sso.email = "TEST@bob.com"
|
||||
|
||||
sso.name = "Louis C.K."
|
||||
|
||||
sso.lookup_or_create_user(ip_address)
|
||||
|
||||
admin.reload
|
||||
|
||||
expect(admin.email).to eq("test@bob.com")
|
||||
expect(admin.username).to eq "bob_the_admin"
|
||||
expect(admin.name).to eq "Louis C.K."
|
||||
end
|
||||
|
||||
it "can fill in data on way back" do
|
||||
|
|
Loading…
Reference in New Issue
Block a user