Sha256: 55a6f4ac688368cf3e42f8a089b0ebe50c12188666fbd2325b8f07f44e1f661f

Contents?: true

Size: 680 Bytes

Versions: 60

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class OmniauthProvider
    def self.available
      Rails.application.secrets[:omniauth] || {}
    end

    def self.enabled
      available.select do |_provider, settings|
        settings[:enabled] == true
      end
    end

    def self.extract_provider_key(enabled_setting_key)
      enabled_setting_key.gsub("omniauth_settings_", "")
                         .gsub("_enabled", "").to_sym
    end

    def self.extract_setting_key(setting_key, provider)
      setting_key.gsub("omniauth_settings_#{provider}_", "").to_sym
    end

    def self.value_defined?(value)
      value.is_a?(String) && value.present?
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.4 app/models/decidim/omniauth_provider.rb
decidim-core-0.27.9 app/models/decidim/omniauth_provider.rb
decidim-core-0.29.0 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.3 app/models/decidim/omniauth_provider.rb
decidim-core-0.27.8 app/models/decidim/omniauth_provider.rb
decidim-core-0.29.0.rc4 app/models/decidim/omniauth_provider.rb
decidim-core-0.29.0.rc3 app/models/decidim/omniauth_provider.rb
decidim-core-0.29.0.rc2 app/models/decidim/omniauth_provider.rb
decidim-core-0.29.0.rc1 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.2 app/models/decidim/omniauth_provider.rb
decidim-core-0.27.7 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.1 app/models/decidim/omniauth_provider.rb
decidim-core-0.27.6 app/models/decidim/omniauth_provider.rb
decidim-core-0.26.10 app/models/decidim/omniauth_provider.rb
decidim-core-0.26.9 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.0 app/models/decidim/omniauth_provider.rb
decidim-core-0.27.5 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.0.rc5 app/models/decidim/omniauth_provider.rb
decidim-core-0.28.0.rc4 app/models/decidim/omniauth_provider.rb