Sha256: 01ac0fab5a177a5b3515f045764352432d68488c2c674744aef1ad47f5315e1c

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

module DeviseOtpAuthenticatable
  module Controllers
    module UrlHelpers

      def recovery_otp_token_for(resource_or_scope, opts = {})
        scope = ::Devise::Mapping.find_scope!(resource_or_scope)
        send("recovery_#{scope}_otp_token_path", opts)
      end

      def refresh_otp_credential_path_for(resource_or_scope, opts = {})
        scope = ::Devise::Mapping.find_scope!(resource_or_scope)
        send("refresh_#{scope}_otp_credential_path", opts)
      end

      def persistence_otp_token_path_for(resource_or_scope, opts = {})
        scope = ::Devise::Mapping.find_scope!(resource_or_scope)
        send("persistence_#{scope}_otp_token_path", opts)
      end

      def otp_token_path_for(resource_or_scope, opts = {})
        scope = ::Devise::Mapping.find_scope!(resource_or_scope)
        send("#{scope}_otp_token_path", opts)
      end

      def otp_credential_path_for(resource_or_scope, opts = {})
        scope = ::Devise::Mapping.find_scope!(resource_or_scope)
        send("#{scope}_otp_credential_path", opts)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devise-otp-0.4.0 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp-0.3.0 lib/devise_otp_authenticatable/controllers/url_helpers.rb