Skip to content

Commit

Permalink
Fix error message when session expires (#7957)
Browse files Browse the repository at this point in the history
* fix session notification

* change notification script

* revert notification

* Update src/Utils/request/handleResponse.ts

Co-authored-by: Rithvik Nishad <[email protected]>

---------

Co-authored-by: Rithvik Nishad <[email protected]>
  • Loading branch information
AshrafMd-1 and rithviknishad authored Jun 14, 2024
1 parent b857722 commit c4b1fd0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Utils/request/handleResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ export default function handleResponse(
navigate(`/session-expired?redirect=${window.location.href}`);
}

// Handle session expiry
if (error?.detail === "Authentication credentials were not provided.") {
notify?.Error({ msg: "Session expired. Please Login again." });
return;
}

notify?.Error({ msg: error?.detail || "Something went wrong...!" });
return;
}
Expand Down

0 comments on commit c4b1fd0

Please sign in to comment.