Also perform logout if explicit creds change

This commit is contained in:
Akhil 2024-08-08 22:09:34 +05:30
parent ae74f21242
commit 50265b3b37

View file

@ -119,12 +119,21 @@ class FetchController extends Controller {
]);
}
// Logout as the credentials have changed
SnappyMailHelper::loadApp();
\RainLoop\Api::Actions()->DoLogout();
return new JSONResponse([
'status' => 'success',
'Message' => $this->l->t('Saved successfully'),
'Email' => $sEmail
]);
} catch (Exception $e) {
// Logout as the credentials might have changed, as exception could be in one attribute
// TODO: Handle both exceptions separately?
SnappyMailHelper::loadApp();
\RainLoop\Api::Actions()->DoLogout();
return new JSONResponse([
'status' => 'error',
'Message' => $e->getMessage()