Skip to content

Commit 15ea162

Browse files
committed
fix(webapp): obfuscate infra error message on token endpoint too
1 parent 0e300c3 commit 15ea162

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/webapp/app/routes/api.v1.token.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { generateErrorMessage } from "zod-error";
88
import { logger } from "~/services/logger.server";
99
import { getPersonalAccessTokenFromAuthorizationCode } from "~/services/personalAccessToken.server";
10+
import { clientSafeErrorMessage } from "~/utils/prismaErrors";
1011

1112
export async function action({ request }: ActionFunctionArgs) {
1213
logger.info("Getting PersonalAccessToken from AuthorizationCode", { url: request.url });
@@ -45,7 +46,7 @@ export async function action({ request }: ActionFunctionArgs) {
4546
logger.error("Error getting PersonalAccessToken from AuthorizationCode", fields);
4647
}
4748

48-
return json({ error: error.message }, { status: 400 });
49+
return json({ error: clientSafeErrorMessage(error) }, { status: 400 });
4950
}
5051

5152
return json({ error: "Something went wrong" }, { status: 400 });

0 commit comments

Comments
 (0)