Fix signup for some OAuth providers

some OAuth providers (kerberos for example) only provide a username and an email, but no name. Therefore
a signup fails because the name is empty. Best guess for the name is
probably the username, therefore use it as name.
This commit is contained in:
Steffen Köhler 2016-01-07 19:14:41 +01:00
parent 03604b39eb
commit 2444c04055
2 changed files with 5 additions and 1 deletions

View file

@ -17,6 +17,7 @@ v 8.4.0 (unreleased)
- Expire view caches when application settings change (e.g. Gravatar disabled) (Stan Hu)
- Don't notify users twice if they are both project watchers and subscribers (Stan Hu)
- Remove gray background from layout in UI
- Fix signup for OAuth providers that don't provide a name
- Implement new UI for group page
- Implement search inside emoji picker
- Add API support for looking up a user by username (Stan Hu)

View file

@ -141,9 +141,12 @@ module Gitlab
username = auth_hash.username
email = auth_hash.email
end
name = auth_hash.name
name = ::Namespace.clean_path(username) if name.strip.empty?
{
name: auth_hash.name,
name: name,
username: ::Namespace.clean_path(username),
email: email,
password: auth_hash.password,