Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Make isTokenExpired stricter

Carlos Monastyrskiabf36db47e06
diff --git a/frontend/src/config/request.ts b/frontend/src/config/request.ts
index f9b21c4260..a37b38cb6b 100644
--- a/frontend/src/config/request.ts
+++ b/frontend/src/config/request.ts
@@ -61,11 +61,9 @@ apiRequest.interceptors.response.use(
if (isAuthenticatedRequest && !isRedirecting) {
// Check if the error indicates token expiration
const errorMessage = response.data?.message || "";
- const isTokenExpired =
- errorMessage.toLowerCase().includes("token") &&
- (errorMessage.toLowerCase().includes("expired") ||
- errorMessage.toLowerCase().includes("invalid") ||
- errorMessage.toLowerCase().includes("unauthorized"));
+ const isTokenExpired = errorMessage
+ .toLowerCase()
+ .includes("your token has expired. please re-authenticate.");
if (isTokenExpired) {
isRedirecting = true;