Skip to content

Commit

Permalink
Also perform logout if explicit creds change
Browse files Browse the repository at this point in the history
  • Loading branch information
akhil1508 committed Aug 8, 2024
1 parent ae74f21 commit 50265b3
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,21 @@ public function setPersonal(): JSONResponse {
]);
}

// 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()
Expand Down

0 comments on commit 50265b3

Please sign in to comment.