Sha256: bb5888facd408dc0ecde3932602d5ced9e7df4a5267294fcb2f012bb02100cbb

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

# Third party dependency
require 'omniauth-google-oauth2'

# Core files
require 'kadmin/auth/unauthorized_error'
require 'kadmin/auth/configuration'
require 'kadmin/auth/user'
require 'kadmin/auth/user_store'

module Kadmin
  module Auth
    class << self
      def users
        @users ||= config.user_store_class.new
      end

      def config
        return @config ||= Kadmin::Auth::Configuration.new
      end

      def configure
        yield(config) if block_given?
        return config
      end

      def omniauth_provider
        return config.oauth_credentials.present? ? :google_oauth2 : :developer
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kadmin-0.3.2 lib/kadmin/auth.rb