mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 21:26:40 +00:00
Correct SCIM Token TTL ms
This commit is contained in:
@@ -403,7 +403,7 @@ export const scimServiceFactory = ({
|
|||||||
if (Number(ttlDays) > 0) {
|
if (Number(ttlDays) > 0) {
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
const scimTokenCreatedAt = new Date(createdAt);
|
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);
|
const expirationDate = new Date(scimTokenCreatedAt.getTime() + ttlInMilliseconds);
|
||||||
|
|
||||||
if (currentDate > expirationDate)
|
if (currentDate > expirationDate)
|
||||||
|
|||||||
+2
-2
@@ -103,7 +103,7 @@ export const ScimTokenModal = ({
|
|||||||
const onFormSubmit = async ({ description, ttlDays }: FormData) => {
|
const onFormSubmit = async ({ description, ttlDays }: FormData) => {
|
||||||
try {
|
try {
|
||||||
if (!currentOrg?.id) return;
|
if (!currentOrg?.id) return;
|
||||||
|
|
||||||
const { scimToken } = await createScimTokenMutateAsync({
|
const { scimToken } = await createScimTokenMutateAsync({
|
||||||
organizationId: currentOrg.id,
|
organizationId: currentOrg.id,
|
||||||
description,
|
description,
|
||||||
@@ -283,7 +283,7 @@ export const ScimTokenModal = ({
|
|||||||
|
|
||||||
let expiresAt;
|
let expiresAt;
|
||||||
if (ttlDays > 0) {
|
if (ttlDays > 0) {
|
||||||
expiresAt = new Date(new Date(createdAt).getTime() + ttlDays * 86400);
|
expiresAt = new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user