Sha256: 9cb5c17095a7278c7ab53056d1aed866c9f33a943dbab195173826aa97d298eb

Contents?: true

Size: 842 Bytes

Versions: 2

Compression:

Stored size: 842 Bytes

Contents

module ActionDispatch::Routing
  class Mapper
    protected

    def devise_otp(mapping, controllers)
      namespace :otp, module: :devise_otp do
        resource :token, only: [:show, :update, :destroy],
          path: mapping.path_names[:token], controller: controllers[:otp_tokens] do
          if Devise.otp_trust_persistence
            get :persistence, action: "get_persistence"
            post :persistence, action: "clear_persistence"
            delete :persistence, action: "delete_persistence"
          end

          get :recovery
        end

        resource :credential, only: [:show, :update],
          path: mapping.path_names[:credentials], controller: controllers[:otp_credentials] do
          get :refresh, action: "get_refresh"
          put :refresh, action: "set_refresh"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-otp-0.6.0 lib/devise_otp_authenticatable/routes.rb
devise-otp-0.5.0 lib/devise_otp_authenticatable/routes.rb