Skip to content

Instantly share code, notes, and snippets.

@hujuu
Created August 29, 2023 09:46
Show Gist options
  • Save hujuu/226396e477bdfa7e963d9479db6a010a to your computer and use it in GitHub Desktop.
Save hujuu/226396e477bdfa7e963d9479db6a010a to your computer and use it in GitHub Desktop.
import { getSession, withApiAuthRequired } from '@auth0/nextjs-auth0';
import { NextResponse } from 'next/server';
const GET = withApiAuthRequired(async () => {
const session = await getSession();
return NextResponse.json(session?.user);
});
export { GET };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment