mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Fixed all broken specs
Moved middleware config into authenticators
This commit is contained in:
parent
912d4b853b
commit
213ce33af2
20 changed files with 137 additions and 328 deletions
|
@ -45,4 +45,15 @@ class Auth::GithubAuthenticator < Auth::Authenticator
|
|||
github_user_id: data[:github_user_id]
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
def register_middleware(omniauth)
|
||||
omniauth.provider :github,
|
||||
: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"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue