How to manage same user for multiple apps

I have 3 apps with different profiles Studio, Teacher and Student.
I have a situation where a single user with email, for example, abc@abc.com, registered using one application and now wants to access another application using the same email and password.
How should I deal with this scenario?

When you setup the new apps, did you tell them to use the same database? If you did not setup using the same database, you can access the other database by setting up an external collection and use the API details from the app with the database you want to use. I would recommend setting up the apps again but using the same database (if you have not already done loads of work on them that is).

Hi, thanks for your reply. I haven’t started creating yet, my question would be whether I could have 3 apps for different profiles, more so that they can access any of the 3 apps with the same login and password. I don’t want to force the user to create 3 accounts. Understood?

1 Like

Hi Fabricio,

You can do this by creating 3 apps that share the same database. Create your first app normally and then every other app you create afterwards, you should link to the database from the first app you create.

To do this, when you create your second app, on step 3, click advanced options…

Then you get the options to create a new database or share a database with an existing app. If you select this option you can then select the app which has the database you want to use…

Once you have this done, you can then add all the fields you want from the 3 apps to the user collection and then control what fields can be seen on registration forms.

This will allow the users to sign in with all 3 apps.

You can also separate the users (if you wish to) by creating 3 true/false fields in the users collection and name them whatever you want, for example ‘app 1’, ‘app 2’, ‘app 3’. Now you have these fields you can set the the field to ‘true’ automatically when a user signs up on a specific app. So if a user signs up using app 1, set the fields for sign up to add the automatic field as seen below…

image

Doing this will then allow you to filter lists in the different apps and only show users who have registered with that specific app, all whilst sharing the same database.

Hope this helps.

Cheers
Craig