Next.js Discord

Discord Forum

Page Locking

Unanswered
Britannia Petite posted this in #help-forum
Open in Discord
Britannia PetiteOP
Anoyne know how i'd lock some pages behind an custom authentication procedure.
I'm using the app layout.

Basically, I want to export "requiredFlag = 'testFlag'" from my pages, then it checks in the authenticated user (using nextauth) for the flag and then renders the page.

I want to avoid putting the same locking function in every page as it's inefficient, instead have it handle it automatically.

0 Replies