Nextjs: Using a non-auth related search parameter code
can be very problematic!
#770
Labels
bug
Something isn't working
code
can be very problematic!
#770
This maybe isn't a complete bug, but I think it's something people should be aware of. An extra warning could be nice.
I was using
code=123
as a URL search param, completely unrelated to auth. Spent a couple hours trying to debug why a certain route was clearing auth cookies completely, turns out its because the nextjs auth callback file that you find in the supabase docs uses that search param.This results in this error:
helpers.js:108 POST http://localhost:54321/auth/v1/token?grant_type=pkce 403 (Forbidden)
andThis was a pretty tough one to debug. I would recommend adding a hint to the 403 PKCE forbidden error, or switching the search param here to use something more unique to supabase.
The text was updated successfully, but these errors were encountered: