summaryrefslogtreecommitdiff
path: root/lib/gitlab/o_auth
diff options
context:
space:
mode:
authorSteffen Köhler <git@steffenkoehler.net>2016-01-07 19:14:41 +0100
committerSteffen Köhler <git@steffenkoehler.net>2016-01-15 14:55:52 +0100
commit2444c04055c7cc7d48c0301e8cd9d30fc534d460 (patch)
treea7cdd3f5b4bc2eeb26009d59ec595844abd078aa /lib/gitlab/o_auth
parent03604b39eb043ca81eed6f3192abe5eef7cd06be (diff)
downloadgitlab-ce-2444c04055c7cc7d48c0301e8cd9d30fc534d460.tar.gz
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.
Diffstat (limited to 'lib/gitlab/o_auth')
-rw-r--r--lib/gitlab/o_auth/user.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/o_auth/user.rb b/lib/gitlab/o_auth/user.rb
index f1a362f5303..e3d2cc65a8f 100644
--- a/lib/gitlab/o_auth/user.rb
+++ b/lib/gitlab/o_auth/user.rb
@@ -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,