mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: GitHub auth always asking to verify email for new users (#5487)
This commit is contained in:
@ -42,13 +42,11 @@ class Auth::GithubAuthenticator < Auth::Authenticator
|
||||
# need to know.
|
||||
user = user_info.user
|
||||
result.email = data[:email],
|
||||
result.email_valid = !!data[:email_verified]
|
||||
result.email_valid = data[:email].present?
|
||||
else
|
||||
# Potentially use *any* of the emails from GitHub to find a match or
|
||||
# register a new user, with preference given to the primary email.
|
||||
all_emails = Array.new(auth_token[:extra][:all_emails])
|
||||
all_emails.unshift(email: data[:email],
|
||||
verified: !!data[:email_verified])
|
||||
|
||||
# Only consider verified emails to match an existing user. We don't want
|
||||
# someone to be able to create a GitHub account with an unverified email
|
||||
|
Reference in New Issue
Block a user