Browse Source

Fixed bug: Argon2 secret differs after app-reinitialization in test env.

Thorsten Eckel 6 years ago
parent
commit
8d078e7398
1 changed files with 2 additions and 3 deletions
  1. 2 3
      lib/password_hash.rb

+ 2 - 3
lib/password_hash.rb

@@ -50,11 +50,10 @@ module PasswordHash
   end
 
   def argon2
-    return @argon2 if @argon2
-    @argon2 = Argon2::Password.new(secret: secret)
+    @argon2 ||= Argon2::Password.new(secret: secret)
   end
 
   def secret
-    Setting.get('application_secret')
+    @secret ||= Setting.get('application_secret')
   end
 end