Sha256: 02ae9e4cb03b015e3e32cc62e54c0354bc6c6a90717b431b42700d948aae1bca
Contents?: true
Size: 843 Bytes
Versions: 37
Compression:
Stored size: 843 Bytes
Contents
class Eco::API::Common::People::DefaultParsers::LoginProvidersParser < Eco::API::Common::Loaders::Parser attribute "login_provider_ids" parsing_phase :final serializing_phase :final def parser(hash, _deps) hash["login_provider_ids"].map do |name| login_providers.to_id(name&.downcase&.strip).tap do |known| unless !name || known || unknown_pgs.include?(name) unknown_pgs.push(name) log(:warn) { "Unknown Login Provider: '#{name}'" } end end end.compact end def serializer(hash, _deps) if (ids = hash["login_provider_ids"]) login_providers.to_name(ids) else [] end end private def unknown_pgs @unknown_pgs ||= [] end def login_providers @login_providers ||= config.login_providers end end
Version data entries
37 entries across 37 versions & 1 rubygems