hotkey crashed every page — useSession was outside provider
- GlobalSupportHotkey is mounted in the ROOT layout.tsx, but
- <SessionProvider> is only wrapped at the [locale]/admin subtree level.
- Calling useSession() outside that provider throws synchronously, which
- flipped every public + admin page into the global error boundary
- ('Something went wrong').
- Replaces useSession() with a lazy fetch of /api/auth/session that only
- fires AFTER the modal opens — provider-agnostic, never blocks render,
- and still pre-fills name/email when the visitor is signed in.
a32b7b5View on GitHub →