mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 08:26:10 +00:00
Make isTokenExpired stricter
This commit is contained in:
@@ -61,11 +61,9 @@ apiRequest.interceptors.response.use(
|
|||||||
if (isAuthenticatedRequest && !isRedirecting) {
|
if (isAuthenticatedRequest && !isRedirecting) {
|
||||||
// Check if the error indicates token expiration
|
// Check if the error indicates token expiration
|
||||||
const errorMessage = response.data?.message || "";
|
const errorMessage = response.data?.message || "";
|
||||||
const isTokenExpired =
|
const isTokenExpired = errorMessage
|
||||||
errorMessage.toLowerCase().includes("token") &&
|
.toLowerCase()
|
||||||
(errorMessage.toLowerCase().includes("expired") ||
|
.includes("your token has expired. please re-authenticate.");
|
||||||
errorMessage.toLowerCase().includes("invalid") ||
|
|
||||||
errorMessage.toLowerCase().includes("unauthorized"));
|
|
||||||
|
|
||||||
if (isTokenExpired) {
|
if (isTokenExpired) {
|
||||||
isRedirecting = true;
|
isRedirecting = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user