I have created a React SPA where I want to login using a social provider. I have created a Login component that is located within a Navbar component where I do the API fetch. But for some reason, I can’t get it to work. I got a CORS policy error. So I added the ‘no-cors’ mode to disabled it. When I test again, nothing happens at all. Strange thing is, if I copy-paste the API fetch link directly into my browser and then run it, I can sign in with google which takes me to my home page.
Here is the code below where I do the fetching:
Note that I didn’t mention DOMAIN_NAME en client_id for safety reasons.
Thanks for your reply. I’m also not sure what the error is, as nothing happens when I click on the Login button. But I was able to fix this using the webauth from auth0-js instead. See code below
import { WebAuth } from ‘auth0-js’;
import ‘./Login.css’;