Anyone know how I can get the user id for a certain user in Auth?
Let's say I am logged in with current user jalla@gmail.com, then I can get userid by
let userId = FIRAuth.auth()?.currentUser?.uid
But if I want to get the userId of the other user jarra@gmail.com while I am logged in as jalla@gmail.com.
How can I do that?
This is how I create a new user:
FIRAuth.auth()?.createUser(withEmail: txtUsername.text!, password: txtPassword.text!, completion: {
user, error in
if error != nil {
print("error: " + error.debugDescription)
}
else{
print("User created")
self.login()
}
})
Which result in the authenticated user in the image attached.
I also have a Users table, but this has nothing to do with authenticating users for login.
The thing is that I need to programatically add new authenticated users. Which is ok, but how can I query data from the Authenticated table? I need to do it because I add the authenticated uid to each user roots in the database (see User table image)