I am trying to store the logged in user as a session in react native. Here is the code where I check for the login credential:
login = () => {
// code to retrieve from firebase
query.once( 'value', data => {
data.forEach(userSnapshot => {
let userKey = userSnapshot.key;
var accountData = userSnapshot.val();
var password = accountData.password;
if(passwordInput != password){
console.log('invalid credential.');
}else{
console.log('successful logged in.');
// store the userKey as session to be used in other pages
}
});
});
}
I managed to grab the unique push ID for user if successfully logged in. Any idea on how to store it as a session?
Thanks in advance