fix: bump trpc and openapi packages (#1591)

This commit is contained in:
David Nguyen
2025-01-19 22:07:02 +11:00
committed by GitHub
parent 9e03747e43
commit 0d3864548c
99 changed files with 1651 additions and 1607 deletions

View File

@ -6,6 +6,7 @@ import { TeamMemberRole } from '@documenso/prisma/client';
// temporary choice for testing only
import * as timeConstants from '../../constants/time';
import { AppError, AppErrorCode } from '../../errors/app-error';
import { alphaid } from '../../universal/id';
import { hashString } from '../auth/hash';
@ -42,7 +43,9 @@ export const createApiToken = async ({
});
if (!member) {
throw new Error('You do not have permission to create a token for this team');
throw new AppError(AppErrorCode.UNAUTHORIZED, {
message: 'You do not have permission to create a token for this team',
});
}
}
@ -56,10 +59,6 @@ export const createApiToken = async ({
},
});
if (!storedToken) {
throw new Error('Failed to create the API token');
}
return {
id: storedToken.id,
token: apiToken,