Module: OmniAuth::Identity::SecurePassword

Included in:
Models::ActiveRecord
Defined in:
lib/omniauth/identity/secure_password.rb

Overview

This is lightly edited from Rails 6.1 code and is used if the version of ActiveModel that’s being used does not include SecurePassword. The only difference is that instead of using ActiveSupport::Concern, it checks to see if there is already a has_secure_password method.

Defined Under Namespace

Modules: ClassMethods Classes: InstanceMethodsOnActivation

Constant Summary collapse

MAX_PASSWORD_LENGTH_ALLOWED =

BCrypt hash function can handle maximum 72 bytes, and if we pass password of length more than 72 bytes it ignores extra characters. Hence need to put a restriction on password length.

BCrypt::Engine::MAX_SECRET_BYTESIZE

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.min_costObject

:nodoc:



23
24
25
# File 'lib/omniauth/identity/secure_password.rb', line 23

def min_cost
  @min_cost
end

Class Method Details

.included(base) ⇒ Object



13
14
15
# File 'lib/omniauth/identity/secure_password.rb', line 13

def self.included(base)
  base.extend(ClassMethods) unless base.respond_to?(:has_secure_password)
end