bigcommerce / storefront-data-hooks

Hooks for React Storefront UI Components
MIT License
166 stars 36 forks source link

Missing Reset password hook #14

Closed MatixYo closed 3 years ago

MatixYo commented 3 years ago

Currently there's no way to reset password using these hooks.

magicspon commented 3 years ago

I can't see anything in the bigcommerce api docs about resetting passwords... any pointers?

jorgemasta commented 3 years ago

There are a couple of options for resetting a user’s password:

  1. https://developer.bigcommerce.com/api-reference/store-management/customers-v3/customers/customersput force_password_reset set to true will trigger an email to be sent to the customer to reset their password
  2. You can post to https://store-STORE_HASH-CHANNEL_ID.mybigcommerce.com/login.php?action=send_password_email for the appropriate channel and this will send the right email with the correct links. (Watch out for CORS)
andrewf414 commented 3 years ago

FYI options 1 doesn't seem to be quite enough to trigger the email, you have to attempt login. So I just did that and then did the useLogin hook with a phony password to trigger the email. The problem now is the email is something we have no control over and the link is to /login.php?action=change_password&c=&t=. So not sure how that gels with a headless app...

kogan007 commented 3 years ago

FYI options 1 doesn't seem to be quite enough to trigger the email, you have to attempt login. So I just did that and then did the useLogin hook with a phony password to trigger the email. The problem now is the email is something we have no control over and the link is to /login.php?action=change_password&c=&t=. So not sure how that gels with a headless app...

You can try syncing bigcommerce login with something like firebase and then if someone successfuly resets their password with firebase use the bigcommerce api to change the password.

jorgemasta commented 3 years ago

FYI options 1 doesn't seem to be quite enough to trigger the email, you have to attempt login. So I just did that and then did the useLogin hook with a phony password to trigger the email. The problem now is the email is something we have no control over and the link is to /login.php?action=change_password&c=&t=. So not sure how that gels with a headless app...

You can try syncing bigcommerce login with something like firebase and then if someone successfuly resets their password with firebase use the bigcommerce api to change the password.

Yes, thats seems to be a good workaround as BC doesn't support password reset through its API at the moment and this package support SSO Login.

I am closing this ticket until further news from the BC API.