Julien ๐
BABetter Auth
โขCreated by Julien ๐ on 5/18/2025 in #help
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!
7 replies