Sha256: abc1a4881dace57796aef69807f05ac434c1ff270db1986387233b0d7b0a01ed

Contents?: true

Size: 646 Bytes

Versions: 1

Compression:

Stored size: 646 Bytes

Contents

module ExpressAdmin
  class OauthSignInLinks < ExpressTemplates::Components::Configurable

    has_argument :providers, "OAuth providers to generate links for", as: :providers, type: :array

    contains -> {
      span(class: 'text-gray') { "Login with:" }
      providers.each do |provider|
        sign_in_link(provider)
      end
    }

    def sign_in_link(provider)
      link_to "#{provider_name(provider)}", user_omniauth_authorize_path(provider), class: 'hollow button button-login'
    end

    private

    def provider_name(provider)
      provider.to_s.humanize
    end

    def providers
      config[:providers]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
express_admin-1.7.9 app/components/express_admin/oauth_sign_in_links.rb