v4: Supabase: updatePassword not working
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)
5 Replies
Hey @l0zz1! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
It seems that you're missing the
redirectTo
property in the updatePassword
method's return object. In refine v4, the updatePassword
method requires promises to be resolved in all cases, with a return type of AuthActionResponse
. You should always resolve the promise with a success
key and an additional error
key in case of a failure. The useUpdatePassword
hook no longer has default redirection, so you need to add the redirectTo
property to the return object source (https://refine.dev/docs/migration-guide/auth-provider).
Update your updatePassword
method like this:
For success notifications, you can use the notification.open
method from Ant Design System source (https://refine.dev/docs/advanced-tutorials/data-provider/supabase). Add success notifications to your forgotPassword
and updatePassword
methods like this:
Make sure to adjust the redirectTo
property according to your desired route after a successful password update.
----------------------<@151783171510370305> kapa.ai is still learning and improving, please let us how it did by reacting below
Hey @l0zz1 ,
Have you reviewed our Supabase example? All the features you mentioned are already integrated. Check it out at https://refine.dev/docs/examples/data-provider/supabase/
Supabase | refine
Connect your Supabase database with refine Supabase Data Provider and easily manage all the features that the database offers in your interface. This example will show you how Supabase Data Provider works and is used.
Note for those who find and read this topic in the future: https://discord.com/channels/837692625737613362/1087345760330330183/1087652039523311646
fascinating-indigo•2y ago