1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-05 05:37:45 +02:00

V2.3.3 fix error logout only if own user is deleted

This commit is contained in:
trendschau
2024-03-25 22:51:24 +01:00
parent 4dfcd626e0
commit bf5dcfd5cb
3 changed files with 9 additions and 3 deletions

View File

@@ -0,0 +1 @@
127.0.0.1;2024-03-25 21:48:49;login: wrong password

View File

@@ -394,15 +394,17 @@ class ControllerApiSystemUsers extends Controller
return $response->withHeader('Content-Type', 'application/json')->withStatus(500);
}
$logout = false;
# if user deleted his own account
if($username == $request->getAttribute('c_username'))
{
$logout = true;
Session::stopSession();
}
$response->getBody()->write(json_encode([
'message' => Translations::translate('User deleted.'),
'logout' => true
'logout' => $logout
]));
return $response->withHeader('Content-Type', 'application/json');

View File

@@ -115,11 +115,14 @@ const app = Vue.createApp({
self.showModal = false;
self.messageClass = 'bg-teal-500';
self.message = response.data.message;
if(response.data.logout !== undefined)
if(response.data.logout == true)
{
window.location.replace(data.urlinfo.baseurl + '/tm/logout');
}
window.location.replace(data.urlinfo.baseurl + '/tm/users');
else
{
window.location.replace(data.urlinfo.baseurl + '/tm/users');
}
})
.catch(function (error)
{