discourse/lib/auth/auth_provider.rb
Ted Johansson 8cacb9800d
DEV: Remove deprecated AuthProvider attributes (#31443)
A number of attributes on AuthProvider are deprecated for and were marked for removal in 2.9.0.

This PR removes them.
2025-02-25 16:40:35 +08:00

38 lines
605 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
pretty_name
title
frame_width
frame_height
pretty_name_setting
title_setting
custom_url
icon
]
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