FIX: stop stripping dots from SSO names

This could upset Louis C.K.
This commit is contained in:
Sam 2015-03-27 10:25:32 +11:00
parent adc9e68e66
commit 05737effef
2 changed files with 5 additions and 2 deletions

View File

@ -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? && (

View File

@ -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