OAuth with TikTok failing — “code_challenge” error on redirect
Hi! I’m integrating BetterAuth in my Next.js app with a custom PostgreSQL schema via Prisma. Everything works fine locally, but when I try to sign in with the TikTok provider on my deployed Vercel app, I’m redirected to a TikTok error page saying:
“An error occurred. TikTok login failed. This may be due to application-specific settings. If you’re a developer, fix the following and try again: code_challenge.”
I’m not doing any manual PKCE handling in my code, and I assumed BetterAuth manages it internally.
Here’s my current BetterAuth config:
Also, my signIn call looks like this:
Is there something I’m missing regarding PKCE or TikTok support on BetterAuth?
Thanks a lot for your help!
3 Replies
@Julien 🍁 You figure this out? Running into this now as well
no 😞
@Julien 🍁 I cannot seem to find a solution or even really what the issue is
woah I got it to work