![]() function LandingPage(props) from '././firebase' Ĭonst = useState() Ĭonst username = props.email. You can use + as strings can be added or use string interpolation (which is more elegant). ![]() I tried creating directly in firebase a document with the same UID as the logging user but the data that i am logging is still the last added document instead of the right for the specific user. Im trying to update the users profile after he created his account, but i cant find a way to trigger onAuthStateChanged() after updatingProfile().It seems like updating user profile is not considering as an auth change. The recommended way to get the current user is by setting an observer on the Auth object: Web version 9 Web version 8 Learn more about the tree-shakeable Web v9 modular SDK and upgrade from version. You just need to join the first and last names together. How do i attach the User to see its own data. And at that point I thought that at this point it would be better to create an Endpoint API that the moment a user needs to be created it receives a username and password and creates it both the field in 'Authentication' and the. Currently, in my Firebase I have only 1 Collection which is Users and contains some documents any of the documents has their own fields it is all hardcoded for the sake of the test.Īfter the log in I am currently logging data but I only see the last added document. The solution I found is to use a firebase function that every time a user is created it reflects it in firestore. However, I am trying to figure out how to fetch the data for the specific logged in user. How to display User name in profile page - react / firebase. Got my Landing page in here with hardcoded username / password into firebase db.Īfter successful login, I am redirected to the homepage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |