Hi I cloned your gh repo for the “email magic links using stytch.js” Example App. I’m able to load the website locally → enter my email → receive an email with magic link → as soon as I click on the link it redirects to a page that says “There was an error authenticating the user” (yes I inputted the appropriate credentials in my .env file and I added the redirect URL with the correct path). Any help here is greatly appreciated!
Hey Hasan – thanks for posting!
It looks like you’ve been running into
pkce_expected_code_verifier errors while attempting to use our
stytchjs-html-express example app. This is because this specific example app isn’t set up to work with our Proof Key for Code Exchange (PKCE) feature – sorry for the confusion!
If you’d like to continue using our
stytchjs-html-express example app, I’d recommend turning off PKCE for the time being via the SDK configuration tab in the Stytch Dashboard (under the “Email Magic Links” section).
It’s also totally possible to set up PKCE via one of our backend authentication flows, it just takes a few more steps that we haven’t yet implemented in
Please let me know if you have any additional questions about this, and I’ll be happy to help!