From 961eecd9b709e2b4404a61fedfbc3657f5a5e11e Mon Sep 17 00:00:00 2001
From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Date: Thu, 14 Apr 2022 13:50:52 +0000
Subject: [PATCH] Bug 28998: [TO_BE_SQUASHED] Adjust secret in Selenium test
Content-Type: text/plain; charset=utf-8

This patch can be squashed with the previous one, if all is ok.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
---
 t/db_dependent/selenium/authentication_2fa.t | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/t/db_dependent/selenium/authentication_2fa.t b/t/db_dependent/selenium/authentication_2fa.t
index 6fc42228e7..25854efd0f 100755
--- a/t/db_dependent/selenium/authentication_2fa.t
+++ b/t/db_dependent/selenium/authentication_2fa.t
@@ -21,7 +21,6 @@ use Test::More tests => 2;
 use C4::Context;
 use Koha::AuthUtils;
 use Koha::Auth::TwoFactorAuth;
-use Koha::Encryption;
 use t::lib::Mocks;
 use t::lib::Selenium;
 use t::lib::TestBuilder;
@@ -81,7 +80,7 @@ SKIP: {
         $s->submit_form;
         is( $driver->find_element('//div[@class="two-factor-status"]')->get_text(), 'Status: Enabled', '2FA is enabled' );
         $patron = $patron->get_from_storage;
-        is( Koha::Encryption->new->decrypt_hex($patron->secret), $secret32, 'encrypted secret is set in DB' );
+        is( $patron->decoded_secret, $secret32, 'encrypted secret is set in DB' );
 
     };
 
@@ -90,7 +89,7 @@ SKIP: {
 
         my $mainpage = $s->base_url . q|mainpage.pl|;
 
-        my $secret32 = Koha::Encryption->new->decrypt_hex($patron->secret);
+        my $secret32 = $patron->decoded_secret;
         { # ok first try
             $driver->get($mainpage . q|?logout.x=1|);
             $driver->get($s->base_url . q|circ/circulation.pl?borrowernumber=|.$patron->borrowernumber);
-- 
2.20.1