0

Hi I have an app where it have user and admin. So i have defined my role in firestore and based on the app i have fetched the pages. Here both user and admin can login to same app but in profile functions there is a function for manage pages this is where i have used the role based access. In admin page i tried created new users with FirebaseAuth.instance.createuserwithemailandpassword (). When it creates it has to be added to a listview. But when i add a new user through bottom sheet it passes the created user uid and shows details for created users. But what i require is the details to be remained same when logged in not after creating the user? Would it he possible or is there a way for doing it?

Jude Harshan
  • 7
  • 1
  • 3
  • It's really hard to tell what you're asking, since we can't see any code or observe how your app is working. Please edit the question to be more clear what isn't working the way you expect. – Doug Stevenson Dec 18 '20 at 17:01

1 Answers1

1

When you create a new user in Firebase with a client-side SDK, it replaces any user that is currently signed in. That is the expected behavior, as the client-side SDKs are not meant for administrative activities like what you're describing.

If you want to have an application administrator who can create accounts for other users, consider creating a custom backend API for them, where you then use the Admin SDK to create the account(s). This also makes it much less likely that you're run into issues with the quota for creating accounts from a single IP.

Also see:

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807