Skip to content

Commit aa61fd6

Browse files
authored
Fix app router API example (#1475)
2 parents 44b1c0f + a7867a7 commit aa61fd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Requests to `/api/protected` without a valid session cookie will fail with `401`
251251
// app/api/protected/route.js
252252
import { withApiAuthRequired, getSession } from '@auth0/nextjs-auth0';
253253

254-
export default withApiAuthRequired(async function myApiRoute(req) {
254+
export const GET = withApiAuthRequired(async function myApiRoute(req) {
255255
const res = new NextResponse();
256256
const { user } = await getSession(req, res);
257257
return NextResponse.json({ protected: 'My Secret', id: user.sub }, res);

0 commit comments

Comments
 (0)