Skip to content

Commit

Permalink
Fix Supabase breaking change on PASSWORD_RECOVERY (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
rphlmr authored Jun 1, 2023
1 parent f2af08d commit fcce5a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/routes/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit fcce5a0

Please sign in to comment.