Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
6143cef4
Commit
6143cef4
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
4198b58a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
lib/gitlab/oauth/user.rb
lib/gitlab/oauth/user.rb
+1
-0
spec/lib/gitlab/oauth/user_spec.rb
spec/lib/gitlab/oauth/user_spec.rb
+12
-0
No files found.
lib/gitlab/oauth/user.rb
View file @
6143cef4
...
@@ -73,6 +73,7 @@ module Gitlab
...
@@ -73,6 +73,7 @@ module Gitlab
end
end
def
email
def
email
return
unless
auth
.
info
.
respond_to?
(
:email
)
auth
.
info
.
email
.
downcase
unless
auth
.
info
.
email
.
nil?
auth
.
info
.
email
.
downcase
unless
auth
.
info
.
email
.
nil?
end
end
...
...
spec/lib/gitlab/oauth/user_spec.rb
View file @
6143cef4
...
@@ -41,5 +41,17 @@ describe Gitlab::OAuth::User do
...
@@ -41,5 +41,17 @@ describe Gitlab::OAuth::User do
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
end
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
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