I have a Flask API which is returning valid JSON, but the Vue3 front end which fetches from the endpoint is returning error:
Access to fetch at 'https://accounts.google.com/o/oauth2/auth?response_type=code&
client_id=*******' (redirected from 'https://127.0.0.1:7070/')
from origin 'http://localhost:5173' has been blocked by CORS policy:
enter code here The 'Access-Control-Allow-Origin' header has a value
'http://localhost:5173' that is not equal to the supplied origin. Have
the server send the header with a valid value, or, if an opaque response
serves your needs, set the request's mode to 'no-cors' to fetch the
resource with CORS disabled.
The API calls the Google Calendar API to retrieve events, so it goes through the authentication process.
Error appears to relate to calling "auth_uri":"https://accounts.google.com/o/oauth2/auth"
The API in both the init file and the application file, I have included:
from flask_cors import CORS
CORS(app)
Why would the front end encounter this issue, if the endpoint returns fine on its own?
Any suggestions on how to resolve this?