mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
Also perform logout if explicit creds change
This commit is contained in:
parent
ae74f21242
commit
50265b3b37
|
@ -119,12 +119,21 @@ class FetchController extends Controller {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Logout as the credentials have changed
|
||||||
|
SnappyMailHelper::loadApp();
|
||||||
|
\RainLoop\Api::Actions()->DoLogout();
|
||||||
|
|
||||||
return new JSONResponse([
|
return new JSONResponse([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'Message' => $this->l->t('Saved successfully'),
|
'Message' => $this->l->t('Saved successfully'),
|
||||||
'Email' => $sEmail
|
'Email' => $sEmail
|
||||||
]);
|
]);
|
||||||
} catch (Exception $e) {
|
} 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([
|
return new JSONResponse([
|
||||||
'status' => 'error',
|
'status' => 'error',
|
||||||
'Message' => $e->getMessage()
|
'Message' => $e->getMessage()
|
||||||
|
|
Loading…
Reference in a new issue