Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Prevent app crash on auth events

Bakoura Ibrahima8d6eda4b4927
diff --git a/apps/docs/pages/guides/auth/auth-helpers/remix.mdx b/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
index 6b30622ed86..83a1a969067 100644
--- a/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
+++ b/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
@@ -493,7 +493,7 @@ useEffect(() => {
const {
data: { subscription },
} = supabase.auth.onAuthStateChange((event, session) => {
- if (session?.access_token !== serverAccessToken) {
+ if (event !== "INITIAL_SESSION" && session?.access_token !== serverAccessToken) {
// server and client are out of sync.
// Remix recalls active loaders after actions complete
fetcher.submit(null, {