Skip to content

Commit

Permalink
fix: axios await throws exception if error is detected
Browse files Browse the repository at this point in the history
  • Loading branch information
jjgancfer committed Apr 15, 2024
1 parent 0596ef8 commit e91f00e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions webapp/src/components/auth/AuthManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ export default class AuthManager {
if (response.status === HttpStatusCode.Ok) {
this.#saveToken(response);
AuthManager.#instance.setLoggedIn(true);
} else {
}
} catch (error) {
if (error.response.status === HttpStatusCode.Forbidden) {
localStorage.removeItem("jwtRefreshToken");
} else {
console.error("Error refreshing token: ", error);
}
} catch (error) {
console.error("Error refreshing token: ", error);
}
}

Expand Down

0 comments on commit e91f00e

Please sign in to comment.