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
iv
gitlab-ce
Commits
5436d6af
Commit
5436d6af
authored
Apr 07, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make oauth works for google oauth too
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
021faad3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
CHANGELOG
CHANGELOG
+1
-0
lib/gitlab/oauth/user.rb
lib/gitlab/oauth/user.rb
+8
-2
No files found.
CHANGELOG
View file @
5436d6af
...
@@ -8,6 +8,7 @@ v 6.8.0
...
@@ -8,6 +8,7 @@ v 6.8.0
- Create branches via API (sponsored by O'Reilly Media)
- Create branches via API (sponsored by O'Reilly Media)
- Changed permission of gitlab-satellites directory not to be world accessible
- Changed permission of gitlab-satellites directory not to be world accessible
- Protected branch does not allow force push
- Protected branch does not allow force push
- Allow oauth signup without email for twitter and github
v 6.7.3
v 6.7.3
- Fix the merge notification email not being sent (Pierre de La Morinerie)
- Fix the merge notification email not being sent (Pierre de La Morinerie)
...
...
lib/gitlab/oauth/user.rb
View file @
5436d6af
...
@@ -30,11 +30,17 @@ module Gitlab
...
@@ -30,11 +30,17 @@ module Gitlab
user
=
model
.
build_user
(
opts
,
as: :admin
)
user
=
model
.
build_user
(
opts
,
as: :admin
)
user
.
skip_confirmation!
user
.
skip_confirmation!
# Services like twitter and github does not return email via oauth
# In this case we generate temporary email and force user to fill it later
if
user
.
email
.
blank?
if
user
.
email
.
blank?
user
.
generate_tmp_oauth_email
user
.
generate_tmp_oauth_email
end
user
.
save!
(
validate:
false
)
user
.
save!
(
validate:
false
)
else
# Google oauth returns email but dont return nickname
# So we use part of email as username for new user
user
.
username
=
email
.
match
(
/^[^@]*/
)[
0
]
user
.
save
end
log
.
info
"(OAuth) Creating user
#{
email
}
from login with extern_uid =>
#{
uid
}
"
log
.
info
"(OAuth) Creating user
#{
email
}
from login with extern_uid =>
#{
uid
}
"
...
...
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