Salut,
Ma chinuit de vreo cateva ore sa fac sa mearga autentificarea pe frontend cu google.
Pe backend am NestJS si am facut cu Passport si strategia de google-auth care separat merge foarte bine, adica fac request la BACKEND_URL/auth/google si ma redirecteaza automat catre google unde ma autentific ai spoi imi da raspunsul pe BACKEND_URL/auth/google/redirect .
Cand incerc de pe frontendul care e facut in NextJS sa apelez BACKEND_URL/auth/google primesc eroarea:
Access to XMLHttpRequest at ‘Inloggen - Google Accounts’ (redirected from ‘http://localhost:4005/auth/google’) from origin ‘http://localhost:3000’ 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.
Nu imi dau seama, dar gresesc ceva aici. Am incercat diverse variante si nu imi merge. In google console este configurat si url-ul de unde fac requesturi (localhost:3000)