Reputation: 139
I use firebase authentication. I need to get the firebase id when using the signInWithEmailAndPassword function. I try to get firebase id using result. But I coudn't.
firebase Authentication function
const signInresponse = await firebaseAuth.signInWithEmailAndPassword(email, password).then((res)=>{
console.log(res);
})
history.push('/User/Directory');
} catch (e) {
console.error(e);
}
Upvotes: 1
Views: 175
Reputation: 246
The user id is inside the user object of the result.
const signInresponse = await firebaseAuth.signInWithEmailAndPassword(email, password).then((res)=>{
console.log(res.user.uid);
})
history.push('/User/Directory');
} catch (e) {
console.error(e);
}
Upvotes: 1