I have been fighting with an (firebase & nodejs) issue and it's 4th part of that problem, How can i pass data after login to server.js
I have tried this But failed to get it working.
Basically i am trying to send user idToken to server to get it verified.
This what i have tried:
const promise = auth.signInWithEmailAndPassword(email, pass).then(function(){
$('.load-bar').hide();
firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) {
// Send token to your backend via HTTPS
console.log(data);
$http.get('server', {params: {idToken: idToken}})
.success(
function(success){
console.log('success');
})
.error(
function(error){
console.log(error)
});
}).catch(function(error) {
// Handle error
});
});
But it's doing nothing no error not success and on server.js
app.get('/server', function(req,res, next){
console.log(req.query.idToken);
});
But still nothing. What am i doing wrong?