mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
fix(ui): resolves range error that happaned when providing a large ttl in scim
This commit is contained in:
+9
-2
@@ -245,15 +245,22 @@ export const ScimTokenModal = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Pr
|
||||
data &&
|
||||
data.length > 0 &&
|
||||
data.map(({ id, description, ttlDays, createdAt }) => {
|
||||
const isInvalidTTLDays = ttlDays > 9999; // added validation later so some users would still be using this
|
||||
let expiresAt;
|
||||
if (ttlDays > 0) {
|
||||
expiresAt = new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
|
||||
expiresAt = isInvalidTTLDays
|
||||
? new Date()
|
||||
: new Date(new Date(createdAt).getTime() + ttlDays * 86400 * 1000);
|
||||
}
|
||||
|
||||
return (
|
||||
<Tr className="h-10 items-center" key={`mi-client-secret-${id}`}>
|
||||
<Td>{description === "" ? "-" : description}</Td>
|
||||
<Td>{expiresAt ? format(expiresAt, "yyyy-MM-dd HH:mm:ss") : "-"}</Td>
|
||||
<Td>
|
||||
{expiresAt && !isInvalidTTLDays
|
||||
? format(expiresAt, "yyyy-MM-dd HH:mm:ss")
|
||||
: "-"}
|
||||
</Td>
|
||||
<Td>{format(new Date(createdAt), "yyyy-MM-dd HH:mm:ss")}</Td>
|
||||
<Td>
|
||||
<IconButton
|
||||
|
||||
Reference in New Issue
Block a user