Merge pull request #3797 from Infisical/ENG-2690

feat: Lower token lifetime to 1 day (refresh 14 days) and fix CLI refresh token functionality
This commit is contained in:
x032205
2025-06-19 12:05:24 -04:00
committed by GitHub
21 changed files with 77 additions and 67 deletions
+7 -4
View File
@@ -50,7 +50,8 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
200: z.object({
token: z.string(),
isMfaEnabled: z.boolean(),
mfaMethod: z.string().optional()
mfaMethod: z.string().optional(),
refreshToken: z.string().optional()
})
}
},
@@ -101,7 +102,7 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
maxAge: 0
});
return { token: tokens.access, isMfaEnabled: false };
return { token: tokens.access, isMfaEnabled: false, refreshToken: tokens.refresh };
}
});
@@ -129,7 +130,8 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
encryptedPrivateKey: z.string(),
iv: z.string(),
tag: z.string(),
token: z.string()
token: z.string(),
refreshToken: z.string().optional()
})
}
},
@@ -172,7 +174,8 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
tag: data.user.tag,
protectedKey: data.user.protectedKey || null,
protectedKeyIV: data.user.protectedKeyIV || null,
protectedKeyTag: data.user.protectedKeyTag || null
protectedKeyTag: data.user.protectedKeyTag || null,
refreshToken: data.token.refresh
} as const;
}
});