How are you guys implementing auth in the app router? I want to const session = await getSession() in both my layout.tsx and multiple page.tsx files, and I understand the underlying fetches to my DB would be deduped (but not cached). However, from my testing, I see that when I navigate from route-a/page.tsx to route-b/page.tsx, it fetches to my DB again, as expected. However, the session in route-b/page.tsx is now no longer guaranteed to be the same as the session in layout.tsx, which kept its value from the previous navigation. This could lead to my layout showing a logged in user but my page showing a user is not logged in.
What I'm used to from SvelteKit is that you have a middleware hook that populates event.locals which is recreated for every request, and can be used in both layouts and pages. I don't think Next 13 Middleware allows a similar thing.
How are you solving this? (Note that I'm not using and don't want to use next-auth.)