i try connect google account electron vue js application.
first have code in vue js app :
axios.get('http://localhost:3000/auth/google', {withcredentials: true}) .then(function (response) { console.log(response) }) .catch(function (err) { console.log(err) })
second have code on node js server
app.get('/auth/google', passport.authenticate( 'google', { scope : ['profile', 'email', 'https://mail.google.com/'] } ) );
and use cors node js
app.use(cors({ origin: 'http://localhost:9080', credentials: true, allowedheaders: ['content-type', 'authorization'] }));
finally have error =(
xmlhttprequest cannot load https://accounts.google.com/o/oauth2[...] redirect 'https://accounts.google.com/o/oauth2 [...] 'https://accounts.google.com/servicelogin[...] has been blocked cors policy: no 'access-control-allow-origin' header present on requested resource. origin 'null' therefore not allowed access
thank !
Comments
Post a Comment