-1

So basically i have to program an app in Angular with ionic. There should be a admin account which should be able to create an account. This admin account should then be able to create subaccounts with the email and then there should be generated an temporary password for the subaccount.

I am pretty new to Angular/Ionic so sorry for my question. Thanks!!

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    my suggestion is to create a firebase cloud function to do account creation. If you try to create the accounts on the client, it will just become a hot mess – Aaron Saunders Jan 04 '22 at 19:49

1 Answers1

0

Like Aaron wrote in comment let users create thair accounts. If you wana have controll over accaunts just make a firebase function with will disable account as soon as user create it then moderator or admin can change this status.

Here is an triger function:

exports.sendWelcomeEmail = functions.auth.user().onCreate((user) => {
  // To Do: Set user as disabled
});

More information you can find in a documentation: https://firebase.google.com/docs/functions/auth-events

Mises
  • 4,251
  • 2
  • 19
  • 32
  • I am suggesting that the admin can still create the accounts for the user BUT the account creation should be done in a cloud function – Aaron Saunders Jan 06 '22 at 20:53
  • @AaronSaunders You can edit my answer or make your own if you want to. I just answered like this because i know he is a new user and it might be easiest way for him. – Mises Jan 06 '22 at 22:08