Skip to content

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

chore: align JavaScript fetcher snippet contents with TypeScript

Daniel Szczepanika804f2cfd632
diff --git a/apps/docs/pages/guides/auth/auth-helpers/remix.mdx b/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
index bddceef390d..f15596e84a1 100644
--- a/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
+++ b/apps/docs/pages/guides/auth/auth-helpers/remix.mdx
@@ -440,8 +440,8 @@ And then use a `fetcher` to simulate submitting a form to our action, inside the
const { env, session } = useLoaderData()
const fetcher = useFetcher()
-const [supabase] = useState(
- () => createBrowserClient(env.SUPABASE_URL, env.SUPABASE_ANON_KEY)
+const [supabase] = useState(() =>
+ createBrowserClient(env.SUPABASE_URL, env.SUPABASE_ANON_KEY)
)
const serverAccessToken = session?.access_token
@@ -451,6 +451,8 @@ useEffect(() => {
data: { subscription },
} = supabase.auth.onAuthStateChange((event, session) => {
if (session?.access_token !== serverAccessToken) {
+ // server and client are out of sync.
+ // Remix recalls active loaders after actions complete
fetcher.submit(null, {
method: 'post',
action: '/handle-supabase-auth',