opposite-copperO
Refine•3y ago•
7 replies
opposite-copper

v4: Supabase: updatePassword not working

forgotPassword: async ({ email }) => {
    const { error } = await supabaseClient.auth.resetPasswordForEmail(
      email, { redirectTo: "http://localhost:3000/update-password" }
    );

    if (error) {
      return {
        success: false,
        error,
      };
    }

    return {
      success: true,
    };
  },
  updatePassword: async ({newPassword}) => {
    const { data, error } = await supabaseClient.auth.updateUser({password: newPassword,});

    if (error) {
      return {
        success: false,
        error,
      };
    }

    return {
      success: true,
    };
  }


Everything is working, but the updatePassword isnt. The page is loading and there are no undefined errors or such, but the password isnt changed. AND also, there are no success notifications, not even on the resetPasswordEmail 😄

Tip to anyone reading this: to solve any issue with routing, make sure to name the folders in Kebab Case (check Docs or files in node_modules for exact details on the route names)
Was this page helpful?