Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -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