MaxM
Deno3y ago
Max

Custom `401 Unauthorized` error page, similar to builtin `404 Not Found`?

How can I create a custom error page that is rendered by middleware in Fresh? The middleware handles authentication for incoming requests and if a request fails authentication, the middleware should generate a 401 Unauthorized response that includes the body of the custom error page.
Was this page helpful?