From a7867a7f1bca094adb0468b12c2b44127dd0ec69 Mon Sep 17 00:00:00 2001 From: Adam Mcgrath Date: Thu, 5 Oct 2023 09:23:40 +0100 Subject: [PATCH] Fix app router API example --- EXAMPLES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXAMPLES.md b/EXAMPLES.md index 8ea915fc8..c3817a9fc 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -251,7 +251,7 @@ Requests to `/api/protected` without a valid session cookie will fail with `401` // app/api/protected/route.js import { withApiAuthRequired, getSession } from '@auth0/nextjs-auth0'; -export default withApiAuthRequired(async function myApiRoute(req) { +export const GET = withApiAuthRequired(async function myApiRoute(req) { const res = new NextResponse(); const { user } = await getSession(req, res); return NextResponse.json({ protected: 'My Secret', id: user.sub }, res);