Sha256: 460464de95fe736a6df5c9eaa1873ff93249ebdd115a62755e131ca59adafd42

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 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

6 entries across 6 versions & 3 rubygems

Version Path
devise-otp2-0.2.6 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp2-0.2.5 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp2-0.2.4 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp-rails5-0.2.4 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp-0.2.3 lib/devise_otp_authenticatable/controllers/url_helpers.rb
devise-otp-0.2.2 lib/devise_otp_authenticatable/controllers/url_helpers.rb