mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:51:14 +08:00
DEV: Explicitly define primary_email_verified? method for managed authenticators (#19127)
We're going to change the default return value of the `primary_email_verified?` method of `Auth::ManagedAuthenticator` to false, so we need to explicitly define the method on authenticators to return true where it makes sense to do so. Internal topic: t/82084.
This commit is contained in:
@ -57,4 +57,10 @@ class Auth::GithubAuthenticator < Auth::ManagedAuthenticator
|
||||
},
|
||||
scope: "user:email"
|
||||
end
|
||||
|
||||
# the omniauth-github gem only picks up the primary email if it's verified:
|
||||
# https://github.com/omniauth/omniauth-github/blob/0ac46b59ccdabd4cbe5be4a665df269355081915/lib/omniauth/strategies/github.rb#L58-L61
|
||||
def primary_email_verified?(auth_token)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user