Having trouble sending the firebase token to the backend. I initially suspected that the issue was due to the function not being asynchronous, but even after adjusting it, the problem persists. Any assistance or guidance on this matter would be greatly appreciated. Thank you!
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('Whether it works or not')
})
.catch((error) => {
console.log(error);
});
}).catch(function(error) {
console.log(error)
});
The error message in the console shows: "POST http: // localhost: 8000 / api / google-login 500 (Internal Server Error)", however, manually copying and sending the idtoken to the backend seems to work fine.