Vercel Preview Kinde Authentication not working
The authentication works on the main deployment, but does not work on the deployment for any branches.
I've attached the error message.
I have followed this guide, and added the callbacks for any branch by using wildcards.
I dynamically produce the Kinde post login redirects by using the next.config file.
Kinde docs
Next.js App Router SDK
Our developer tools provide everything you need to get started with Kinde.
2 Replies
@Jack maybe watch this video and see if there is anything that stands out as helping you.
https://youtu.be/ZNuE7CkB6ck?si=At8ZHQA2oP1WV-c6
https://kinde.com/blog/engineering/deploy-a-kinde-app-on-vercel/
Kinde
YouTube
How to deploy a Kinde Next.js app with Vercel
Software engineer Peter takes you through how to deploy a Kinde app using Vercel, and covers the common pitfalls involved.
00:00 - App demo
0:46 - Creating a project on Vercel
1:19 - Initialising Github repo
2:49 - Setting up environment variables on Vercel
4:00 - Deploying and visiting the app on the Vercel Domain
5:13 - Updating environment ...
Kinde Blog
Deploy a Kinde app on Vercel
This guide covers everything you could need to deploy a Kinde app to Vercel.
{"error":"Error: State not found.\nTo resolve this error please visit our docs https://docs.kinde.com/developer-tools/sdks/backend/nextjs-sdk/#state-not-found-errorAuthentication flow: Received: 5987629af3801a73716141689f20 | Expected: State not found"}
I am having this problem.
After watching the video and reading the docs, I am still confused.
The docs state: "Confirm that the domain you start the auth flow from is different from the domain you are redirected to after the auth flow is complete. but in the video (@6:07), it seems like hes using the same domain? his site url is lumon.vercel.app and then redirect login is lumon.vercel.app/dashboard
Kinde docs
Next.js App Router SDK
Our developer tools provide everything you need to get started with Kinde.