我不能发送firebase令牌到后端,我认为问题是函数不是异步的,但它仍然不能为我工作,请帮助我,谢谢!
user.getIdToken(true)
.then(function(idToken) {
const path = 'http://localhost:8000/api/google-login'
console.log(idToken)
axios.post(path , idToken)
.then((response) => {
console.log('anda o no anda')
})
.catch((error) => {
console.log(error);
});
}).catch(function(error) {
console.log(error)
});控制台中的错误。发布http: // localhost: 8000 / api / google-login 500 (内部服务器错误),但如果我复制idtoken并手动将其发送到后端,它可以工作。
发布于 2021-03-29 01:45:52
您现在可以这样做了,您发送的令牌没有您的密钥
‘axios.post(path,{'token_id':idToken})’
https://stackoverflow.com/questions/66753768
复制相似问题