Sha256: a83cee0d68be0f4c71b012d071f93803881180cc1f0187644816ed53caca309a

Contents?: true

Size: 1.39 KB

Versions: 17

Compression:

Stored size: 1.39 KB

Contents

require 'devise'
require 'rack/oauth2'
require 'devise/oauth2/engine'
require 'devise/oauth2/expirable_token'
require 'devise/oauth2/strategies/oauth2_providable_strategy'
require 'devise/oauth2/strategies/oauth2_password_grant_type_strategy'
require 'devise/oauth2/strategies/oauth2_refresh_token_grant_type_strategy'
require 'devise/oauth2/strategies/oauth2_authorization_code_grant_type_strategy'
require 'devise/oauth2/models/oauth2_providable'
require 'devise/oauth2/models/oauth2_password_grantable'
require 'devise/oauth2/models/oauth2_refresh_token_grantable'
require 'devise/oauth2/models/oauth2_authorization_code_grantable'

module Devise
  module Oauth2
    CLIENT_ENV_REF = 'oauth2.client'
    REFRESH_TOKEN_ENV_REF = "oauth2.refresh_token"

    class << self
      def random_id
        SecureRandom.hex
      end
      def table_name_prefix
        'oauth2_'
      end
    end
  end
end

Devise.add_module(:oauth2,
  :strategy => true,
  :model => 'devise/oauth2/models/oauth2_providable')
Devise.add_module(:oauth2_password_grantable,
  :strategy => true,
  :model => 'devise/oauth2/models/oauth2_password_grantable')
Devise.add_module(:oauth2_refresh_token_grantable,
  :strategy => true,
  :model => 'devise/oauth2/models/oauth2_refresh_token_grantable')
Devise.add_module(:oauth2_authorization_code_grantable,
  :strategy => true,
  :model => 'devise/oauth2/models/oauth2_authorization_code_grantable')

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
devise_oauth2_rails4-2.1.8 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.7 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.6 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.5 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.4 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.3 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.0.3 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.1.0 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.0.2 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.0.1 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-2.0.0 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.8 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.7 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.6 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.5 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.4 lib/devise_oauth2_rails4.rb
devise_oauth2_rails4-1.1.3 lib/devise_oauth2_rails4.rb