diff --git a/.changeset/strong-carrots-build.md b/.changeset/strong-carrots-build.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/strong-carrots-build.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/nextjs/src/server/protect.ts b/packages/nextjs/src/server/protect.ts index 7e17e37817..3f26166631 100644 --- a/packages/nextjs/src/server/protect.ts +++ b/packages/nextjs/src/server/protect.ts @@ -65,14 +65,16 @@ export function createProtect(opts: { // TODO: Handle runtime values. What happens if runtime values are set in middleware and in ClerkProvider as well? return redirectToSignIn(); } - return notFound(); + notFound(); + return; }; const handleUnauthorized = () => { if (unauthorizedUrl) { return redirect(unauthorizedUrl); } - return notFound(); + notFound(); + return; }; /**