And this does correctly trigger the Login Workflow, it does create the user in supabase, it does redirect to the Auth Route Handler for exchanging the code, it does provide the code to that Route Handler and it does set the
sb-localhost-auth-token-code-verifier
sb-localhost-auth-token-code-verifier
Cookie. However
supabase.auth.exchangeCodeForSession(code);
supabase.auth.exchangeCodeForSession(code);
then runs into an error:
error TypeError: Cannot read properties of null (reading 'split') at SupabaseAuthClient._exchangeCodeForSession (webpack-internal:///(rsc)/../../node_modules/@supabase/gotrue-js/dist/main/GoTrueClient.js:398:132)
error TypeError: Cannot read properties of null (reading 'split') at SupabaseAuthClient._exchangeCodeForSession (webpack-internal:///(rsc)/../../node_modules/@supabase/gotrue-js/dist/main/GoTrueClient.js:398:132)
It seems that for some reason the GoTrueClient is not able to load the code verifier. Its this bit in the GoTrueClient that is throwing the error:
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.