mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 03:53:52 +08:00
812add18bd
At the moment core providers are hard-coded in Javascript, and plugin providers get added to the JS payload at compile time. This refactor means that we only ship enabled providers to the client.
29 lines
602 B
Ruby
29 lines
602 B
Ruby
class Auth::AuthProvider
|
|
include ActiveModel::Serialization
|
|
|
|
def initialize(params = {})
|
|
params.each { |key, value| send "#{key}=", value }
|
|
end
|
|
|
|
def self.auth_attributes
|
|
[:pretty_name, :title, :message, :frame_width, :frame_height, :authenticator,
|
|
:pretty_name_setting, :title_setting, :enabled_setting, :full_screen_login, :full_screen_login_setting,
|
|
:custom_url]
|
|
end
|
|
|
|
attr_accessor(*auth_attributes)
|
|
|
|
def name
|
|
authenticator.name
|
|
end
|
|
|
|
def can_connect
|
|
authenticator.can_connect_existing_user?
|
|
end
|
|
|
|
def can_revoke
|
|
authenticator.can_revoke?
|
|
end
|
|
|
|
end
|