Next.js Discord

Discord Forum

Is it better to handle auth logic in layout/page.js or middleware?

Unanswered
American posted this in #help-forum
Open in Discord
AmericanOP
Anytime I set cookie in middleware, server component fetches the previous cookie value instead of the most recent cookie value. So I'm not sure where I should set my auth logic

0 Replies