Throw NextJs Errors instead of generic within `or` clause

NextJs has great built in methods to handle things like notFound and soon to come the unauthorized function:

https://nextjs.org/docs/app/api-reference/functions/unauthorized

It would be great if the useUser or await getUser functions or parameter could allow for calling of these functions. Sometimes I would prefer to throw a not found if the user is unauthenticated and other times I would prefer to render an unauthorized UI

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

feature-requests

Date

5 months ago

Subscribe to post

Get notified by email when there are changes.