mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Add rubocop to our build. (#5004)
This commit is contained in:
parent
ff4e295c4f
commit
5012d46cbd
871 changed files with 5480 additions and 6056 deletions
|
@ -47,10 +47,8 @@ class Auth::GithubAuthenticator < Auth::Authenticator
|
|||
# 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]
|
||||
})
|
||||
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
|
||||
|
@ -106,14 +104,13 @@ class Auth::GithubAuthenticator < Auth::Authenticator
|
|||
)
|
||||
end
|
||||
|
||||
|
||||
def register_middleware(omniauth)
|
||||
omniauth.provider :github,
|
||||
:setup => lambda { |env|
|
||||
strategy = env["omniauth.strategy"]
|
||||
setup: lambda { |env|
|
||||
strategy = env["omniauth.strategy"]
|
||||
strategy.options[:client_id] = SiteSetting.github_client_id
|
||||
strategy.options[:client_secret] = SiteSetting.github_client_secret
|
||||
},
|
||||
:scope => "user:email"
|
||||
scope: "user:email"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue