use translated message when token has expired

This commit is contained in:
Uwe Steinmann 2022-12-13 11:59:17 +01:00
parent 0b7181b44d
commit a327d9fcaa

View File

@ -947,7 +947,7 @@ class SeedDMS_ExtPaperless_RestAPI_Auth { /* {{{ */
$tmp = explode(':', json_decode($tokenstr, true));
if($tmp[1] < time()) {
$logger->log("Jwt has expired at ".date('Y-m-d H:i:s', $tmp[1]), PEAR_LOG_ERR);
return $response->withJson("Token has expired", 403);
return $response->withJson(getMLText('paperless_token_has_expired'), 403);
} else {
$logger->log("Token is valid till ".date('Y-m-d H:i:s', $tmp[1]), PEAR_LOG_DEBUG);
}