mirror of
https://github.com/documenso/documenso.git
synced 2026-08-19 21:11:54 +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>
|
||||
<Skeleton className="h-4 w-16 rounded-full" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Skeleton className="h-4 w-16 rounded-full" />
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Skeleton className="h-4 w-12 rounded-full" />
|
||||
</TableCell>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
import { logger } from '../../utils/logger';
|
||||
import { hashString } from '../auth/hash';
|
||||
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(),
|
||||
},
|
||||
})
|
||||
.catch(() => null);
|
||||
.catch((err) => {
|
||||
logger.warn({
|
||||
msg: 'Failed to update API token lastUsedAt',
|
||||
apiTokenId: apiToken.id,
|
||||
err,
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
...apiToken,
|
||||
|
||||
Reference in New Issue
Block a user