Sha256: f72d6f8b6e56d7162fb65b614ec607abbef525972b3fcf02f69648d2f9b440d9
Contents?: true
Size: 1.47 KB
Versions: 1
Compression:
Stored size: 1.47 KB
Contents
require 'token_action/engine' require 'securerandom' require 'active_support/concern' require 'orm_adapter' module TokenAction # Returns the default success URL. # # @return [String] the default success URL def self.success_url if Proc === @@success_url @@success_url.call else @@success_url end end # Sets the default success URL. # # @param [String,Proc] a default success URL def self.success_url=(success_url) @@success_url = success_url end # Returns the default failure URL. # # @return [String] the default failure URL def self.failure_url if Proc === @@failure_url @@failure_url.call else @@failure_url end end # Sets the default failure URL. # # @param [String,Proc] a default failure URL def self.failure_url=(failure_url) @@failure_url = failure_url end # Configures TokenAction. # # * `success_url`: the default success URL # * `failure_url`: the default failure URL # # @example # require 'token_action' # # TokenAction.setup do |config| # config.success_url = '/home' # config.failure_url = '/oops' # end def self.setup yield self end # Returns a random alphanumeric string. # # @return [String] a random alphanumeric string # @see Devise::friendly_token def self.friendly_token SecureRandom.base64(15).tr('+/=lIO0', 'pqrsxyz') end end require 'token_action/concerns/token_generator' require 'token_action/concerns/model'
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
token_action-0.0.2 | lib/token_action.rb |