From 8d078e7398b23117d970193f9cc1eef1e387e796 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 28 Sep 2018 14:14:46 +0200 Subject: [PATCH] Fixed bug: Argon2 secret differs after app-reinitialization in test env. --- lib/password_hash.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/password_hash.rb b/lib/password_hash.rb index 0882d789a..b65017065 100644 --- a/lib/password_hash.rb +++ b/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