Google Socialite Login CORS Error
I'm writing this post just to hopefully save some poor sod countless hours debugging in the future because I couldn't find anything myself
in your
app/Providers/Filament/AdminPanelProvider.php
check if you have
"->spa()"
and remove it if you do. I spent 3 fucking days debugging this bullshit and in the end it was this and nothing to do with Google Login.
For some reason with spa enabled it just returns this.
Access to fetch at 'https://accounts.google.com/o/oauth2/auth?client_id=4939' (redirected from 'http://127.0.0.1:8000/auth/google') from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
From what I can tell when spa is enabled it's not sending the proper request headers at all.
0 Replies