mirror of
https://github.com/documenso/documenso.git
synced 2026-08-24 23:32:29 +10:00
fix: log lastUsedAt write failures and align the tokens table skeleton
This commit is contained in:
@@ -160,6 +160,9 @@ export default function ApiTokensPage() {
|
|||||||
<TableCell>
|
<TableCell>
|
||||||
<Skeleton className="h-4 w-16 rounded-full" />
|
<Skeleton className="h-4 w-16 rounded-full" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Skeleton className="h-4 w-16 rounded-full" />
|
||||||
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
<Skeleton className="h-4 w-12 rounded-full" />
|
<Skeleton className="h-4 w-12 rounded-full" />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { prisma } from '@documenso/prisma';
|
import { prisma } from '@documenso/prisma';
|
||||||
|
|
||||||
import { AppError, AppErrorCode } from '../../errors/app-error';
|
import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||||
|
import { logger } from '../../utils/logger';
|
||||||
import { hashString } from '../auth/hash';
|
import { hashString } from '../auth/hash';
|
||||||
import { assertOrganisationRatesAndLimits } from '../rate-limit/assert-organisation-rates-and-limits';
|
import { assertOrganisationRatesAndLimits } from '../rate-limit/assert-organisation-rates-and-limits';
|
||||||
|
|
||||||
@@ -105,7 +106,13 @@ export const getApiTokenByToken = async ({ token, bypassRateLimit = false }: Get
|
|||||||
lastUsedAt: new Date(),
|
lastUsedAt: new Date(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.catch(() => null);
|
.catch((err) => {
|
||||||
|
logger.warn({
|
||||||
|
msg: 'Failed to update API token lastUsedAt',
|
||||||
|
apiTokenId: apiToken.id,
|
||||||
|
err,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...apiToken,
|
...apiToken,
|
||||||
|
|||||||
Reference in New Issue
Block a user