Sha256: 4e5f4119a7a12f56833e9d7d0d3345fb088d9af52a41526ff9f496c4325280dc

Contents?: true

Size: 984 Bytes

Versions: 3

Compression:

Stored size: 984 Bytes

Contents

require 'devise'
require 'devise/duo_security/controllers/helpers'
require 'devise/duo_security/engine'
require 'duo_web'

module Devise
  module DuoSecurity
    class Configuration
      attr_accessor :app_secret, :ikey, :skey, :host
    end

    class << self
      attr_writer :configuration
    end

    def self.configuration
      @configuration ||= Configuration.new
    end

    def self.configure
      yield(configuration)
    end
  end
end

# TODO: Isn't there a better way?
DuoSecurity = Devise::DuoSecurity

Devise.add_module :duo_security, :model => 'devise_duo_sec', :controller => :duo_security, :route => :duo_security

module ActionDispatch::Routing
  class Mapper
    protected

      def devise_duo_security(mapping, controllers)
        resource :duo_security, :only => [:show], :path => mapping.path_names[:duo_security], :controller => controllers[:duo_security] do
          collection do
            post :verify
          end
        end
      end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise_duo_sec-1.0.0 lib/devise_duo_sec.rb
devise_duo_sec-0.1.0 lib/devise_duo_sec.rb
devise_duo_sec-0.0.7 lib/devise_duo_sec.rb