From ff9084a3f5e993b1ba9609e2326494fd97db61dc Mon Sep 17 00:00:00 2001 From: Federico Date: Sat, 13 Jul 2024 22:15:49 -0300 Subject: [PATCH] Add == gotcha that can be unintuitive at first --- lib/bcrypt/password.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bcrypt/password.rb b/lib/bcrypt/password.rb index 4a2c140..3160c9b 100644 --- a/lib/bcrypt/password.rb +++ b/lib/bcrypt/password.rb @@ -73,6 +73,8 @@ def initialize(raw_hash) # @password == @password.to_s # => False # @password.to_s == @password # => True # @password.to_s == @password.to_s # => True + # + # secret == @password # => probably False, because the secret is not a BCrypt::Password instance. def ==(secret) super(BCrypt::Engine.hash_secret(secret, @salt)) end