Magic Link Redirecting Only to First Step

I am embedding my form onto my website at Booking

I know I have to set the redirect URL in Stytch to my form URL – Double Knot App – but that is causing the form to throw an error. You can find the error on the third step of the form (use an NYC address on the first step to route the correct way).

If I set the redirect url to Booking, the magic link doesn’t error, but it always redirects the user to the first step after logging in, no matter what hash I add to the redirect url. How can I redirect the logged in user to the appropriate step when using an embedded form?

Thanks in advance for your help!

Hi @adam, We have tested your form. In the email step, we are seeing an error from stytch. Here is the error that we have observed:

{
    "status_code": 400,
    "request_id": "request-id-live-835e179e-bfb8-481c-b923-4d1658a0eda1",
    "error_type": "no_match_for_provided_magic_link_url",
    "error_message": "The magic_link_url in the request did not match any redirect URLs set for this project. Please visit https://stytch.com/dashboard/redirect-urls to update the redirect URLs for this project. For more information on why this validation is necessary please visit https://stytch.com/docs/api/url-validation",
    "error_url": "https://stytch.com/docs/api/errors/400#no_match_for_provided_magic_link_url"
}

Basically the redirect URLs are mismatching, which is causing this error. Can you address this error and see if the flow is working as expected?

Okay, I reset the Redirect Url to match again so you can test. Notice that the form redirects to the first step rather than the “Hours” step as is designated in my Stytch integration setting.

What are you setting the redirect URL to? I’m seeing it redirect properly on the feathery-hosted version of your form so there’s something going on with the embed specifically

I’m setting the redirect to Booking

Redirecting to the feathery-hosted form throws an error when the form is embedded on that page, and redirecting to that page just returns the user to the first step. It does work on the feathery-hosted version, which made me think that somehow your redirect code doesn’t work on embedded forms.

Additionally, if I open my stytch magic link email from another browser, none of the fields in steps that came prior to the magic link step are saved.

We’ve identified and resolved the issue on our side. Please pass in the additional loginEnabled flag Javascript SDK | Feathery Docs

or re-copy your embed snippet from the Feathery dashboard and copy it into your project.

Should work correctly after this