Rendering a page should not change anything. Nakodo breaks that rule in five places, and every one of them is on purpose, so I went and wrote down the rule they actually follow.
The app runs outreach campaigns for brands: it finds creators or local businesses that fit a brief, writes to them, and hands over the ones that say yes, which is the bit described on how it works . Every page in this post is behind the login, which turns out to be half the reason the pattern is safe.
One: the first page you load creates your account row
export const requireUser = cache ( async (): Promise < SessionUser > => { const user = await getUser (); if ( ! user ) redirect ( " /login " ); if ( ! ( await getProfile ( user . id ))) await db . insert ( profiles ). values ({ id : user . id }). onConflictDoNothing (); return user ; });
Enter fullscreen mode
Exit fullscreen mode
Sign-up creates a profile row.…