Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nextjs): Return 401 Response on protected API routes (#1276)
* feat(nextjs): Return 401 Response on protected API routes This commit introduces a new apiRoutes param on authMiddleware. If apiRoutes is omitted, then a default heuristic is the following: If the route path is ['/api/(.*)', '/trpc/(.*)'] or Request has Content-Type: application/json or Request method is not-GET,OPTIONS,HEAD , then this is considered an API route. * test(nextjs): Fix tests after adding isApiRoute prop to auth object * chore(nextjs): Add changeset * fix(nextjs): Change 401 response body to null * chore(nextjs): Change the description text on apiRoutes prop
- Loading branch information