Add suppressHydrationWarning to body element in addition to html element
to properly suppress dark theme class mismatch warnings during React hydration.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add suppressHydrationWarning to html element to prevent hydration mismatch
caused by theme script setting dark class before React hydration completes.
The hydration errors were preventing checkout and other interactive features
from working properly. This tells React to ignore the mismatch on the html
element since we intentionally modify it before hydration.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Create LogoutOnUnload component that triggers logout on page close
- Uses beforeunload/unload events with navigator.sendBeacon() for reliability
- Create /api/logout endpoint that clears both admin and customer sessions
- Add LogoutOnUnload to root layout so it runs on all pages
- Works for both admin and customer users
Behavior:
- When user closes browser tab/window, logout happens automatically
- Session cookies are cleared via API endpoint
- Improves security by preventing session hijacking from closed windows
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>