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
e6f58cb8
Unverified
Commit
e6f58cb8
authored
Apr 07, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid false validation when create user
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5436d6af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
user.rb
app/models/user.rb
+1
-1
user.rb
lib/gitlab/oauth/user.rb
+1
-2
No files found.
app/models/user.rb
View file @
e6f58cb8
...
@@ -468,6 +468,6 @@ class User < ActiveRecord::Base
...
@@ -468,6 +468,6 @@ class User < ActiveRecord::Base
end
end
def
generate_tmp_oauth_email
def
generate_tmp_oauth_email
self
.
email
=
"temp-email-for-oauth-
#{
username
}
"
self
.
email
=
"temp-email-for-oauth-
#{
username
}
@gitlab.localhost
"
end
end
end
end
lib/gitlab/oauth/user.rb
View file @
e6f58cb8
...
@@ -34,14 +34,13 @@ module Gitlab
...
@@ -34,14 +34,13 @@ module Gitlab
# In this case we generate temporary email and force user to fill it later
# 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
user
.
save!
(
validate:
false
)
else
else
# Google oauth returns email but dont return nickname
# Google oauth returns email but dont return nickname
# So we use part of email as username for new user
# So we use part of email as username for new user
user
.
username
=
email
.
match
(
/^[^@]*/
)[
0
]
user
.
username
=
email
.
match
(
/^[^@]*/
)[
0
]
user
.
save
end
end
user
.
save!
log
.
info
"(OAuth) Creating user
#{
email
}
from login with extern_uid =>
#{
uid
}
"
log
.
info
"(OAuth) Creating user
#{
email
}
from login with extern_uid =>
#{
uid
}
"
if
Gitlab
.
config
.
omniauth
[
'block_auto_created_users'
]
&&
!
ldap?
if
Gitlab
.
config
.
omniauth
[
'block_auto_created_users'
]
&&
!
ldap?
...
...
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