BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
262276c5
Commit
262276c5
authored
Sep 01, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure oath callbacks without a nickname work (google)
parent
5801d520
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
user.rb
lib/gitlab/oauth/user.rb
+1
-0
user_spec.rb
spec/lib/gitlab/oauth/user_spec.rb
+12
-0
No files found.
lib/gitlab/oauth/user.rb
View file @
262276c5
...
...
@@ -86,6 +86,7 @@ module Gitlab
end
def
username
return
unless
auth
.
info
.
respond_to?
(
:nickname
)
auth
.
info
.
nickname
.
to_s
.
force_encoding
(
"utf-8"
)
end
...
...
spec/lib/gitlab/oauth/user_spec.rb
View file @
262276c5
...
...
@@ -68,5 +68,17 @@ describe Gitlab::OAuth::User do
user
=
gl_auth
.
create
(
auth
)
expect
(
user
.
email
).
to_not
be_empty
end
it
'generates a username if non provided (google)'
do
info
=
double
(
uid:
'my-uid'
,
name:
'John'
,
email:
'john@example.com'
)
auth
=
double
(
info:
info
,
provider:
'my-provider'
)
user
=
gl_auth
.
create
(
auth
)
expect
(
user
.
username
).
to
eql
'john'
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment