From d93aa1e91c59632f6d19b5d2404ce96b0b3042f7 Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 7 Jul 2023 16:17:23 +0200 Subject: [PATCH] WIP Mail REST Api: permanent log result of primary backend for fallback auth --- api/src/Auth/Fallback.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/Auth/Fallback.php b/api/src/Auth/Fallback.php index 0cb57f3394..09462b19aa 100644 --- a/api/src/Auth/Fallback.php +++ b/api/src/Auth/Fallback.php @@ -58,7 +58,10 @@ class Fallback implements Backend */ function authenticate($username, $passwd, $passwd_type='text') { - if ($this->primary_backend->authenticate($username, $passwd, $passwd_type)) + $ret = $this->primary_backend->authenticate($username, $passwd, $passwd_type); + Api\Auth::log(__METHOD__."('$username', ...) primary_backend(".get_class($this->primary_backend). + ")->authenticate('$username', '".str_repeat('*', strlen($passwd))."', ...) returned ".json_encode($ret)); + if ($ret) { Api\Cache::setInstance(__CLASS__,'backend_used-'.$username,'primary'); // check if fallback has correct password, if not update it