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:
1
data/security/securitylog.txt
Normal file
1
data/security/securitylog.txt
Normal file
@@ -0,0 +1 @@
|
||||
127.0.0.1;2024-03-25 21:48:49;login: wrong password
|
@@ -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');
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user