Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
5db071d86aa9
Unverified
Commit
e6f58cb8
authored
Apr 07, 2014
by
Dmitriy Zaporozhets
Browse files
Avoid false validation when create user
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
430c710cd302
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/user.rb
View file @
5db071d8
...
...
@@ -468,6 +468,6 @@ def temp_oauth_email?
end
def
generate_tmp_oauth_email
self
.
email
=
"temp-email-for-oauth-
#{
username
}
"
self
.
email
=
"temp-email-for-oauth-
#{
username
}
@gitlab.localhost
"
end
end
lib/gitlab/oauth/user.rb
View file @
5db071d8
...
...
@@ -34,14 +34,13 @@ def create(auth)
# In this case we generate temporary email and force user to fill it later
if
user
.
email
.
blank?
user
.
generate_tmp_oauth_email
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
user
.
save!
log
.
info
"(OAuth) Creating user
#{
email
}
from login with extern_uid =>
#{
uid
}
"
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