mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +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
|
@ -1,12 +1,11 @@
|
|||
class Auth::OpenIdAuthenticator < Auth::Authenticator
|
||||
|
||||
def initialize(name, opts = {})
|
||||
@name = name
|
||||
@opts = opts
|
||||
end
|
||||
attr_reader :name, :identifier
|
||||
|
||||
def name
|
||||
@name
|
||||
def initialize(name, identifier, opts = {})
|
||||
@name = name
|
||||
@identifier = identifier
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
def after_authenticate(auth_token)
|
||||
|
@ -47,4 +46,13 @@ class Auth::OpenIdAuthenticator < Auth::Authenticator
|
|||
active: true
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
def register_middleware(omniauth)
|
||||
omniauth.provider :open_id,
|
||||
:store => OpenID::Store::Redis.new($redis),
|
||||
:name => name,
|
||||
:identifier => identifier,
|
||||
:require => "omniauth-openid"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue