1
0
mirror of https://github.com/Infisical/infisical.git synced 2025-03-29 22:02:57 +00:00

Correct SCIM Token TTL ms

This commit is contained in:
Tuan Dang
2024-02-21 17:00:59 -08:00
parent 318ad25c11
commit bbd9fa4a56
2 changed files with 3 additions and 3 deletions
backend/src/ee/services/scim
frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab

@ -403,7 +403,7 @@ export const scimServiceFactory = ({
if (Number(ttlDays) > 0) {
const currentDate = new Date();
const scimTokenCreatedAt = new Date(createdAt);
const ttlInMilliseconds = Number(scimToken.ttlDays) * 86400;
const ttlInMilliseconds = Number(scimToken.ttlDays) * 86400 * 1000;
const expirationDate = new Date(scimTokenCreatedAt.getTime() + ttlInMilliseconds);
if (currentDate > expirationDate)

@ -103,7 +103,7 @@ export const ScimTokenModal = ({
const onFormSubmit = async ({ description, ttlDays }: FormData) => {
try {
if (!currentOrg?.id) return;
const { scimToken } = await createScimTokenMutateAsync({
organizationId: currentOrg.id,
description,
@ -283,7 +283,7 @@ export const ScimTokenModal = ({
let expiresAt;
if (ttlDays > 0) {
expiresAt = new Date(new Date(createdAt).getTime() + ttlDays * 86400);
expiresAt = new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
}
return (