Currently i want to build 2 meteor apps, one is for public users, the other one is for admins. And both meteor apps are sharing the same database and collections schema. Because there are some common data that will be accessible for both users and admins.
So i would like to have 2 collections to handle authentication for uses and admins.
In the same database, i already have a users collections for public user authentication.
Now i want to create another collection called admins to handle admins authentication, and hopefully I still can use Meteor.user() to identify if user is logged in.
import { Accounts } from āmeteor/accounts-baseā
Accounts.users = new Mongo.Collection(āadminsā);
i have tried the codes as above, then Iām able to call Accounts.createUser() to create admin. However, Meteor.loginWithPassword() will still authenticate with āusersā collections instead of āadminsā collections
And if i want to overwrite Meteor.users Collection as below
Meteor.users = new Mongo.Collection(āadminsā);
This will not help me create āadminsā collection
Any ideas how to achieve this? Or is there an official way to do this that I should know? Thanks!