Post authentication redirect returning HTTP ERROR 500
I've followed Next.js quickstart guide and integrated Kinde into my Next.js app. However, when I create a new user with email and set password, it redirected me to
/api/auth/kinde_callback?code=<code> but it's always returning error 500. The same thing happens for social sign in, it didn't redirect me to the account selector/allow access page of that social sign in, but it returns error 500 as well. The error is also printed out in terminal.