Skip to content

Commit

Permalink
#111 - Fix login fail error message disappearence - Aisha Athman Lali (
Browse files Browse the repository at this point in the history
…#117)

* fix login fail error message disappearence

* fix an eror

* edit code to get the location.pathname

* edit code
  • Loading branch information
aishaathmanlali authored Aug 8, 2024
1 parent 4d31680 commit 78356d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/TenderClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const handleAuthError = (error) => {
if (error.response && error.response.status === 401) {
localStorage.removeItem("authToken");
localStorage.removeItem("userType");
window.location.href = "/";
if (window.location.pathname !== "/") {
window.location.href = "/";
}
} else {
throw error;
}
Expand Down

0 comments on commit 78356d2

Please sign in to comment.