fix: protect correct routes
This commit is contained in:
11
app/api/protected/profile/route.ts
Normal file
11
app/api/protected/profile/route.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
import { getSession, withApiAuthRequired } from '@auth0/nextjs-auth0';
|
||||
|
||||
const GET = withApiAuthRequired(async () => {
|
||||
const session = await getSession();
|
||||
|
||||
return NextResponse.json(session?.user);
|
||||
});
|
||||
|
||||
export { GET };
|
||||
Reference in New Issue
Block a user