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
5801d520
Commit
5801d520
authored
Sep 01, 2014
by
Jan-Willem van der Meer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle user creation if email is not provided
This fixes #1541
parent
0ec4abf7
Hide 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 @
5801d520
...
...
@@ -73,6 +73,7 @@ module Gitlab
end
def
email
return
unless
auth
.
info
.
respond_to?
(
:email
)
auth
.
info
.
email
.
downcase
unless
auth
.
info
.
email
.
nil?
end
...
...
spec/lib/gitlab/oauth/user_spec.rb
View file @
5801d520
...
...
@@ -56,5 +56,17 @@ describe Gitlab::OAuth::User do
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
end
it
"Set a temp email address if not provided (like twitter does)"
do
info
=
double
(
uid:
'my-uid'
,
nickname:
'john'
,
name:
'John'
)
auth
=
double
(
info:
info
,
provider:
'my-provider'
)
user
=
gl_auth
.
create
(
auth
)
expect
(
user
.
email
).
to_not
be_empty
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