Skip to content

Commit fcce5a0

Browse files
authored
Fix Supabase breaking change on PASSWORD_RECOVERY (#73)
1 parent f2af08d commit fcce5a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/routes/reset-password.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ export default function ResetPassword() {
110110
const {
111111
data: { subscription },
112112
} = supabase.auth.onAuthStateChange((event, supabaseSession) => {
113-
if (event === "SIGNED_IN") {
113+
// In local development, we doesn't see "PASSWORD_RECOVERY" event because:
114+
// Effect run twice and break listener chain
115+
if (event === "PASSWORD_RECOVERY" || event === "SIGNED_IN") {
114116
const refreshToken = supabaseSession?.refresh_token;
115117

116118
if (!refreshToken) return;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@remix-run/node": "*",
3131
"@remix-run/react": "*",
3232
"@remix-run/serve": "*",
33-
"@supabase/supabase-js": "^2.8.0",
33+
"@supabase/supabase-js": "^2.24.0",
3434
"cookie": "^0.5.0",
3535
"i18next": "^21.9.1",
3636
"i18next-browser-languagedetector": "^6.1.5",

0 commit comments

Comments
 (0)