Skip to content

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

misc: add proper grace period for max ttl and descriptive comment

Sheen Capadngand08510ebe4f0
diff --git a/backend/src/services/identity-ua/identity-ua-service.ts b/backend/src/services/identity-ua/identity-ua-service.ts
index 69a54d2ccb..53404788ee 100644
--- a/backend/src/services/identity-ua/identity-ua-service.ts
+++ b/backend/src/services/identity-ua/identity-ua-service.ts
@@ -122,7 +122,9 @@ export const identityUaServiceFactory = ({
}
: {
accessTokenTTL: identityUa.accessTokenPeriod,
- accessTokenMaxTTL: identityUa.accessTokenPeriod
+ // Setting Max TTL to 2 × period ensures that clients can always renew their token
+ // at least once, and matches client logic that checks if renewing would exceed Max TTL.
+ accessTokenMaxTTL: 2 * identityUa.accessTokenPeriod
};
const identityAccessToken = await identityUaDAL.transaction(async (tx) => {