Module: Clearance::PasswordStrategies::Blowfish

Defined in:
lib/clearance/password_strategies/deprecated/blowfish.rb

Instance Method Summary collapse

Instance Method Details

#authenticated?(password) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/clearance/password_strategies/deprecated/blowfish.rb', line 9

def authenticated?(password)
  encrypted_password == encrypt(password)
end

#password=(new_password) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/clearance/password_strategies/deprecated/blowfish.rb', line 13

def password=(new_password)
  @password = new_password
  initialize_salt_if_necessary

  if new_password.present?
    self.encrypted_password = encrypt(new_password)
  end
end