FIX: Don't include name in hash when names are disabled.

This could break some SSO implementations due to honeypot
not being triggered.
This commit is contained in:
Robin Ward 2015-10-29 12:19:09 -04:00
parent b9437936ab
commit 0b4c9005f9

View file

@ -46,15 +46,18 @@ class Auth::Result
} }
end end
else else
{ result = { email: email,
email: email, username: UserNameSuggester.suggest(username || name || email),
name: User.suggest_name(name || username || email), # this feels a tad wrong
username: UserNameSuggester.suggest(username || name || email), auth_provider: authenticator_name.capitalize,
# this feels a tad wrong email_valid: !!email_valid,
auth_provider: authenticator_name.capitalize, omit_username: !!omit_username }
email_valid: !!email_valid,
omit_username: !!omit_username if SiteSetting.enable_names?
} result[:name] = User.suggest_name(name || username || email)
end
result
end end
end end
end end