mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
SECURITY: signup without verified email using Google auth
This commit is contained in:
parent
80d0c6df7c
commit
2db66072d7
5 changed files with 46 additions and 4 deletions
|
@ -31,7 +31,7 @@ class Auth::GoogleOAuth2Authenticator < Auth::Authenticator
|
|||
def after_create_account(user, auth)
|
||||
data = auth[:extra_data]
|
||||
GoogleUserInfo.create({ user_id: user.id }.merge(data))
|
||||
if auth[:email_valid].to_s == 'true'
|
||||
if auth[:email_valid].to_s == 'true' && data[:email]&.downcase == user.email
|
||||
EmailToken.confirm(user.email_tokens.first.token)
|
||||
user.set_automatic_groups
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue