return same error as paperless-ngx when login fails

This commit is contained in:
Uwe Steinmann 2023-05-13 17:06:01 +02:00
parent 62d6ab86c5
commit 6116bbfa4d

View File

@ -208,7 +208,7 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
if($data) {
$userobj = $authenticator->authenticate($data['username'], $data['password']);
if(!$userobj)
return $response->withJson(array('token'=>''), 403);
return $response->withJson(array('non_field_errors'=>['Unable to log in with provided credentials.']), 403);
else {
if(!empty($settings->_extensions['paperless']['jwtsecret'])) {
$token = new SeedDMS_JwtToken($settings->_extensions['paperless']['jwtsecret']);