discourse/lib/auth/auth_provider.rb
Chris Alberti 1f227a5eb4
DEV: Add capability to pass an icon setting into auth provider registration (#34584)
Add capability to pass an icon setting into auth provider registration to override the default icon with a site setting.

Matches the pattern we use for the auth provider title and pretty name. 

With this, the SAML plugin can be updated to have a site setting to override the default "user" icon.
2025-08-28 09:14:36 -05:00

42 lines
681 B
Ruby

# frozen_string_literal: true
class Auth::AuthProvider
include ActiveModel::Serialization
def initialize(params = {})
params.each { |key, value| public_send "#{key}=", value }
end
def self.auth_attributes
%i[
authenticator
custom_url
frame_height
frame_width
icon
icon_setting
pretty_name
pretty_name_setting
title
title_setting
]
end
attr_accessor(*auth_attributes)
def can_connect
authenticator.can_connect_existing_user?
end
def can_revoke
authenticator.can_revoke?
end
def name
authenticator.name
end
def provider_url
authenticator.provider_url
end
end