Skip to content

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

prevent access token ttl=0

Maidul Islambb75ea550a0d
diff --git a/backend/src/validation/auth.ts b/backend/src/validation/auth.ts
index e723ba7d9d..12121c61f8 100644
--- a/backend/src/validation/auth.ts
+++ b/backend/src/validation/auth.ts
@@ -116,7 +116,9 @@ export const AddUniversalAuthToIdentityV1 = z.object({
.array()
.min(1)
.default([{ ipAddress: "0.0.0.0/0" }]),
- accessTokenTTL: z.number().int().min(0).default(7200),
+ accessTokenTTL: z.number().int().min(1).refine(value => value !== 0, {
+ message: "accessTokenTTL must have a non zero number",
+ }).default(2592000),
accessTokenMaxTTL: z.number().int().refine(value => value !== 0, {
message: "accessTokenMaxTTL must have a non zero number",
}).default(2592000), // 30 days
diff --git a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthForm.tsx b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthForm.tsx
index 6d327f9d47..99e5b4feab 100644
--- a/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthForm.tsx
+++ b/frontend/src/views/Org/MembersPage/components/OrgIdentityTab/components/IdentitySection/IdentityUniversalAuthForm.tsx
@@ -223,7 +223,7 @@ export const IdentityUniversalAuthForm = ({
{...field}
placeholder="2592000"
type="number"
- min="0"
+ min="1"
step="1"
/>
</FormControl>