diff --git a/app/routes/reset-password.tsx b/app/routes/reset-password.tsx index 07ad659..6f1fff4 100644 --- a/app/routes/reset-password.tsx +++ b/app/routes/reset-password.tsx @@ -110,7 +110,9 @@ export default function ResetPassword() { const { data: { subscription }, } = supabase.auth.onAuthStateChange((event, supabaseSession) => { - if (event === "SIGNED_IN") { + // In local development, we doesn't see "PASSWORD_RECOVERY" event because: + // Effect run twice and break listener chain + if (event === "PASSWORD_RECOVERY" || event === "SIGNED_IN") { const refreshToken = supabaseSession?.refresh_token; if (!refreshToken) return; diff --git a/package.json b/package.json index a1a29c7..b7d77a3 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@remix-run/node": "*", "@remix-run/react": "*", "@remix-run/serve": "*", - "@supabase/supabase-js": "^2.8.0", + "@supabase/supabase-js": "^2.24.0", "cookie": "^0.5.0", "i18next": "^21.9.1", "i18next-browser-languagedetector": "^6.1.5",