2
Doubt consists in the following problem:
I have a project using firebase and Ionic 3. I am using the authentication mode via E-mail, in which you have the email and UID stored.
For example: I have 2 users registered at the base.
[email protected] UID = 123
[email protected] UID = 321
In my code I have a message element that has the id of who is sending, for example:
Message 1 = Description: "Description", idUsuario: "123"
I am logged in with the UID 321 user and want to recover the UID 123 user to display his email, how do I do this?
I did not want to store in the firebase database, but since there is no other way, then, someone would know how to create a registration screen that registers via email/ password and stores in firebase this data.
PS: I am trying to use authentication via logged-in user token to write to the database, but to do the registration there is no token, so I am not getting.
This way:
return this.http
.post(this.urlDataBase + email + '/user.json?auth=' + token, usuario)
.map((response: Response) => {
console.log(response);
return response.json();
});
But it is not saving in firebase, it is giving error 400:
Response {_body: "{↵ "error" : "Invalid path: Invalid token in path"↵}↵", status: 400, ok: false, statusText: "Bad Request", headers: Headers, …}
according to this reply is not possible: https://stackoverflow.com/questions/14673708/how-do-i-return-a-list-of-users-if-i-use-the-firebase-simpleusername-password
– Eduardo Vargas
Only using Authentication is not possible. You will need to use the database
– Rosário Pereira Fernandes
Thank you. Sacanagem not have a way to access this data...
– Thiago Bomfim
The data of your message is stored in the Real Time Data Base of firebase?? when you saved can not put the email soon not?
– Felipe Miranda