K
Kindeβ€’9mo ago
DuocNgo

Vercel deployment - Invalid callback url

Hi team, i just tried to deploy my app to vercel with kinde auth. after follows all the steps on your youtube channel, but still get the error invalid callback url. P/s: i update env and url settings on project already, is there any solution. thanks in advance
46 Replies
Daniel_Kinde
Daniel_Kindeβ€’9mo ago
Hi, have you setup the callback URLs in the kinde dashboard for the application you're using?
DuocNgo
DuocNgoOPβ€’9mo ago
yes, i set it up already. but still get invalid URL
DuocNgo
DuocNgoOPβ€’9mo ago
here is my setup, just follow the guide of your team on kinde youtube channel.
No description
DuocNgo
DuocNgoOPβ€’9mo ago
here is the error screen when i tried to login
No description
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Are you using next.js? I also had a little trouble getting this to work originally and can probably help guide you through it
DuocNgo
DuocNgoOPβ€’9mo ago
yes, i use nextjs 14 mate
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Which video did you follow? can you link it so I can see what you did?
DuocNgo
DuocNgoOPβ€’9mo ago
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 ...
DuocNgo
DuocNgoOPβ€’9mo ago
here is the video i just follow
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Hm as far as I can tell that should be working. Stupid question - you hit save after you set the callback url in the Kinde dashboard? And your vercel env is set correctly?
DuocNgo
DuocNgoOPβ€’9mo ago
yes, save and change the ENV already. im not stupid as that mate :D. thanks for reply
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
I didn't assume, nor insinuate that I think you're stupid. Sometimes with issues like this, simple things are missed or overlooked, I miss things like this all the time. It's always best to cover the simple bases first rather than digging into complex solutions when the issue is right under our noses.
DuocNgo
DuocNgoOPβ€’9mo ago
oh sorry for my reading mistake. i did all these stuffs but still get the error, and i have tried to searching for this term on google already but there is no answer for that. Maybe Kinde is quite new, i will try to do all the steps again. Again, Thanks Joel.
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Does it work for localhost?
DuocNgo
DuocNgoOPβ€’9mo ago
yes, it does.
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Have you tried something as simple as deleting the fuji-recipes entry from your callback settings in Kinde, then saving, then copying the url from the error screen back in? Sometimes computers are weird and things like that work lol
DuocNgo
DuocNgoOPβ€’9mo ago
i did it also, but still get it. tried to close browser, switch to use other browsers too, LoL πŸ˜‚
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
I also tried to log in on your app and it still didn't work
DuocNgo
DuocNgoOPβ€’9mo ago
@Joel i just re-create the app and setup all the stuffs again. Now it works, thanks for your times Joel. Have a great day
MALEV0L3NT
MALEV0L3NTβ€’9mo ago
Computers are weird man, glad you got it working πŸ˜‚
Ash
Ashβ€’8mo ago
@DuocNgo hey man I'm facing the same issue, did you manage to know what the reason was? and by what do you mean by "re-create"ing the app?
DuocNgo
DuocNgoOPβ€’8mo ago
First step, just check your kinde app name in local and the one on your host, if they are not the same, you should create new kinde app and setup the config again, hope you will resolve the error soon.
Ash
Ashβ€’8mo ago
can you explain a little more please? I should compare my kinde project name to what in my code?
DuocNgo
DuocNgoOPβ€’8mo ago
can you show me the snapshot of kinde auth screen on your local app and the one on vercel or somewhere
Ash
Ashβ€’8mo ago
yeah sure, appreciate the help btw
No description
No description
No description
No description
DuocNgo
DuocNgoOPβ€’8mo ago
can i see the fullpage of the 1st picture
Ash
Ashβ€’8mo ago
No description
DuocNgo
DuocNgoOPβ€’8mo ago
let see the url, does it is the same with the link on your local environment?
Ash
Ashβ€’8mo ago
in development everything works
DuocNgo
DuocNgoOPβ€’8mo ago
yes, i understand, but when it navigate to the auth screen in dev env, please take a look at the url
https://chatspdfauth.kinde.com/
https://chatspdfauth.kinde.com/
does it is the same url on the development environment?
Ash
Ashβ€’8mo ago
https://chatspdfauth.kinde.com/ yup same thing
DuocNgo
DuocNgoOPβ€’8mo ago
do you use nextjs? at this modal which is the one do you choose to setup the kinde auth?
No description
Ash
Ashβ€’8mo ago
yeah I did
DuocNgo
DuocNgoOPβ€’8mo ago
did you choose back-end web? if not, you can add the new app with backend-end web type and setup the server again. and that is all steps i had done to make my app works on vercel mate.
Ash
Ashβ€’8mo ago
thanks man for me its backend and still didnt work but appreciate your help
peteswah
peteswahβ€’8mo ago
If you have updated environment variables on vercel, you will have to redeploy your application for the env variables to update - maybe that'll do it? Otherwise you might have to click save in the Kinde Settings after setting callback URLs
Ash
Ashβ€’8mo ago
@peteswah fixed thanks!
Lytemare
Lytemareβ€’8mo ago
I'm having the same trouble except I deployed my app on Amplify.
Daniel_Kinde
Daniel_Kindeβ€’8mo ago
Hi @Lytemare , Have you redeployed since updating your environment variables on Amplify?
Lytemare
Lytemareβ€’8mo ago
How did you fix the issue? Even after I redeploy get the same problem as above: invalid callback URL Unfortunately I cannot get it to work in Amplify under production. Works perfectly well locally when I test it.
Daniel_Kinde
Daniel_Kindeβ€’8mo ago
Can you share details @Lytemare of the callback URL you're getting?
Lytemare
Lytemareβ€’8mo ago
I'm not even getting that error anymore. Just a blank page in Safari. In Chrome, get This page isn’t workingmain.dlrove54zv9py.amplifyapp.com is currently unable to handle this request. HTTP ERROR 500. I don't understand why I have this problem. Works perfectly well localhost:3000. When I update callback url with app domain, it just will not work. Wanted to know how to delete the business? Cannot find this info in any of the docs. I wanted to create a new one and try it that way? Unfortnately Kinde is not going to work in Amplify. Get invalid callback again. Docs on Kinde site are not very helpful.
Daniel_Kinde
Daniel_Kindeβ€’8mo ago
Hi, we run Kinde on amplify internally as part of our test suite, are you able to give more more details on the error you're getting? could you give me a screenshot of the error?
Lytemare
Lytemareβ€’8mo ago
I cleared and re input environment variables in amplify and edited my build settings. Now I can get to the sign on page but when I try to sign on get the following error under url: mydomainname.com/api/auth/kinde_callback?code=w9L89j5MuU-oIBYTbU5k9jaoWMKGNuS9F9ZTI5xMfH0.A1Z0uExLWjmei1yUS_9L4jrgyauRp90T_pYuj-nwhko&scope=openid%20profile%20email%20offline&state=3ad123ca57d4c0c24b0fe9128310
No description
Daniel_Kinde
Daniel_Kindeβ€’8mo ago
Is this after the auth flow has been completed? Are you able to send me a video? You can DM me if you would rather.
Lytemare
Lytemareβ€’8mo ago
In sign up page <RegisterLink> I can input First Name, Last Name and email. I get the verification code. After I enter the verification code I get HTTP error 500 So I tried to deploy my app from vercel instead but I am having the same issue as above. Verified environmental variables. This same app tests perfectly locally
Want results from more Discord servers?
Add your server