Skip to content

Commit b783f6e

Browse files
fix(jokes): throw 403 instead of 401 if the use isn't the owner (#86)
1 parent 97bddf2 commit b783f6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_official-jokes/app/routes/jokes/$jokeId.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const action: ActionFunction = async ({ request, params }) => {
5656
}
5757
if (joke.jokesterId !== userId) {
5858
throw new Response("Pssh, nice try. That's not your joke", {
59-
status: 401,
59+
status: 403,
6060
});
6161
}
6262
await db.joke.delete({ where: { id: params.jokeId } });
@@ -87,7 +87,7 @@ export function CatchBoundary() {
8787
</div>
8888
);
8989
}
90-
case 401: {
90+
case 403: {
9191
return (
9292
<div className="error-container">
9393
Sorry, but {params.jokeId} is not your joke.

0 commit comments

Comments
 (0)