Fix Never api key expiration dates (#4965)

closes #4714 

We cannot set null expiration dates for api keys. So we will set to 100
years instead of null. If apiKey expires in more that 10 years, it is
displayed as "Never expires"
This commit is contained in:
martmull
2024-04-15 20:05:59 +02:00
committed by GitHub
parent 691454ef3b
commit 1c3775e4a0
6 changed files with 41 additions and 20 deletions

View File

@ -1,3 +1,5 @@
import { NEVER_EXPIRE_DELTA_IN_YEARS } from '@/settings/developers/constants/NeverExpireDeltaInYears.ts';
export const EXPIRATION_DATES: {
value: number | null;
label: string;
@ -7,5 +9,5 @@ export const EXPIRATION_DATES: {
{ label: '90 days', value: 90 },
{ label: '1 year', value: 365 },
{ label: '2 years', value: 2 * 365 },
{ label: 'Never', value: null },
{ label: 'Never', value: NEVER_EXPIRE_DELTA_IN_YEARS * 365 },
];

View File

@ -0,0 +1 @@
export const NEVER_EXPIRE_DELTA_IN_YEARS = 100;