'React-Django, Is it possible to get google api data in react frontend?
I use react as frontend, and django as backend.
I want to manipulate google social login without 'react-google-login'
const GOOGLE_LOGIN_URL = `https://accounts.google.com/o/oauth2/v2/auth?client_id=${clientId}&redirect_uri=${redirect_uri}&response_type=code&scope=https://www.googleapis.com/auth/userinfo.email`;
axios({
method: 'get',
url : GOOGLE_LOGIN_URL,
headers: {
"Access-Control-Allow-Origin": '*',
"Access-Control-Allow-Methods": 'GET',
}
})
.then(function (response){
console.log(response);
})
I want to get data from https://accounts.google.com/o/oauth2/v3/auth?cliend_id=...&redirect... but, blocked by CORS policy error occurs. Is it impossible to get data from google api in react frontend? I found the description about this.. picture of developers.google.com/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
