Stytch Magic Link Errors

Hi! Is there a way to change the magic link url? I keep getting an error:

The magic_link_url in the request did not match any redirect URLs set for this project.

with the payload:

{login_magic_link_url: "https://www.housesocial.com/windermere-signup#Windermere%20Sign%20Up",…}
email
:
kate@housesocial.com
login_expiration_minutes
:
1440
login_magic_link_url
:
Create An Account - Windermere — House Social
signup_expiration_minutes
:
1440
signup_magic_link_url
:
Create An Account - Windermere — House Social

https://www.housesocial.com/windermere-signup#Windermere%20Sign%20Up

This URL is where my form is on my website, but it is not the magic link URL. It should be Windermere Membership Dashboard — House Social. The URL listed in the error is not on my Stytch account.

Any help is appreciated! (I present this in 3 hours and I am freaking out)

Hi Kate, the redirect url for Stytch needs to be your form url as the token in the redirect URL needs to be authenticated. You can then redirect user from the form to the url of your website.

Hi! Thank you for the response. How would this work if the form is embedded on my site? Thanks again!

Hi Kate, you can consider creating a new step and set it as the login redirect step for your Stytch integration, and create a button on the step to redirect users to your link.

I’m not sure that would be a good workaround. When I use this API request body and pull the sample response using my email, the response is successful (sends magic link email and redirects to the correct URL).

{
  "email": "{{windermere-email}}",
  "login_magic_link_url": "https://www.housesocial.com/windermere-dashboard",
  "signup_magic_link_url": "https://www.housesocial.com/windermere-dashboard",
  "login_expiration_minutes": 30,
"signup_expiration_minutes": 30
}

When I try the live form on my website, that’s when I see the error:


{
    "status_code": 400,
    "request_id": "request-id-live-c924c2f3-1772-42f7-b743-360d23060ed0",
    "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"
}

with the payload:

{login_magic_link_url: "https://www.housesocial.com/windermere-signup#Windermere%20Sign%20Up",…}
email: "kate@housesocial.com"
login_expiration_minutes:  1440
login_magic_link_url: 
"https://www.housesocial.com/windermere-signup#Windermere%20Sign%20Up"
signup_expiration_minutes: 1440
signup_magic_link_url: 
"https://www.housesocial.com/windermere-signup#Windermere%20Sign%20Up"

I think I’m just a bit confused as to why it works for the sample response and Postman, but not from the live embedded form. Again, any help is appreciated! Thank you!

Hi Kate, not sure what is being set in your Stytch dashboard as the redirect url now, but the redirect url in the payload is the url of your form, and the dashboard should match that in order to successfully authenticate the user.