Hi all,
What would be the best way to get a reset password link in B2B? Say, my user forgot their password and wants to reset it.
Thanks,
Udi
Hi all,
What would be the best way to get a reset password link in B2B? Say, my user forgot their password and wants to reset it.
Thanks,
Udi
Hey Udi â thanks for posting!
I think the Password reset email start endpoint is probably what youâre looking for.
That endpoint will send an email to the userâs email address with a âReset passwordâ button. When they click the button, theyâll be redirected back to your application with a token that they can use to reset their password via the Password email reset endpoint.
Happy to help if you have any additional questions about this!
Thanks Nicole! I think this exactly what Iâm looking for!!
Hey Nicole,
Iâm getting strange errors when I try this. The error complains I need to have a redirect-url - I do have one set up. Regardless, Iâm not sure I understand why thatâs needed for the purpose of a password reset? so Iâm completely unsure what I need to do to make this work. I would be grateful for any advice on how to make this work.
Thanks,
Udi
This is what Iâm running
client = B2BClient(
project_id="...",
secret="...",
)
resp = client.passwords.email.reset_start(
organization_id="...",
email_address="...",
)
and this is what Iâm getting
StytchError: status_code=400 request_id=ârequest-id-test-3fe36fb5-2054-46ed-8a34-ad7421ad8074â error_type=âno_login_redirect_urlâ error_message=âThere are no login redirect URLs registered. To set login redirect URLs for this project please visit Stytch - User infrastructure + passwordless authentication. For more information on why this validation is necessary please visit stytch.com/docs/api/url-validation.â error_url=âAuthentication API reference - errors | Stytchâ original_json={âstatus_codeâ: 400, ârequest_idâ: ârequest-id-test-3fe36fb5-2054-46ed-8a34-ad7421ad8074â, âerror_typeâ: âno_login_redirect_urlâ, âerror_messageâ: âThere are no login redirect URLs registered. To set login redirect URLs for this project please visit Stytch - User infrastructure + passwordless authentication. For more information on why this validation is necessary please visit stytch.com/docs/api/url-validation.â, âerror_urlâ: âAuthentication API reference - errors | Stytchâ}
Heya Udi, our password reset emails also include a link to login without resetting your password; a smoother path to sign in for a lot of users. You can check out what they look like in the Email editor in the Dashboard: https://stytch.com/dashboard/templates
So when you send off a password reset email, youâll need a login_redirect_url
set on your Project.
Hey Chris,
Thanks for the very quick response! I see what the issue was - while I did set a login_redirect_url in the project, I didnât do this on the default project. Once I did that it works. Thanks for the help!
Awesome! Glad we got it fixed quickly.