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.25.0.rc4 app/models/decidim/omniauth_provider.rb
decidim-core-0.25.0.rc3 app/models/decidim/omniauth_provider.rb
decidim-core-0.25.0.rc2 app/models/decidim/omniauth_provider.rb
decidim-core-0.25.0.rc1 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.3 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.6 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.2 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.5 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.1 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.0 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.0.rc2 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.4 app/models/decidim/omniauth_provider.rb
decidim-core-0.24.0.rc1 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.3 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.2 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.1 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.1.rc1 app/models/decidim/omniauth_provider.rb
decidim-core-0.23.0 app/models/decidim/omniauth_provider.rb
decidim-core-0.22.0 app/models/decidim/omniauth_provider.rb
decidim-core-0.21.0 app/models/decidim/omniauth_provider.rb