How to get Multiple Accounts work with one backend service?


#1

meteor 1.1.0.2

We have 3 apps and 1 backend services

  1. for the mobile clients.
  2. for the mobile suppliers.
  3. for our web app.

all of these 3 apps use same backend but use different accounts system, is it possible for now ?

we want to separate these 3 type of users to different collections like

clientUsers = new Mongo.Collection 'client_users'

supplierUsers = new Mongo.Collection 'supplier_users'

Meteor.users = new Mongo.Collection 'users'

#2

What’s the reason for the separation here?

Could you not use roles? suppliers would have the “supplier” role and access control would allow/restrict them from other areas?


#3

that only will make our app big and hard to maintain.

why i have to ship features that clients should never used, then verse vice to suppliers.

what if some suppliers.


#4

This has been published recently: https://medium.com/meteor-js/exploring-users-and-logins-with-meteor-20395446aaed and it covers pretty much what you are after.


#5

@serkandurusoy thank you, i will check it.

for now i use mup to deploy 3 apps separately and enable oplog by manually.

pass MONGO_URL and MONGO_OPLOG_URL to same db, it works fine.

but i think if we can use ddp login everywhere it would be cool.


#6

But you said you want to separate the user collections as well as separate data by feature. By pointing at the same db, you are actually using the same database and the same user collection. (although you are deploying different apps)


#7

@serkandurusoy

i can’t make remote account login working properly.

you can change default users collection by

Meteor.users = new Mongo.Collection 'client_users'

#8

Take a look at the following:


#9

@crapthings : Where do you pass the MONGO_URL and MONGO_OPLOG_URL? In settings.json? Can you please share the code? Thanks


#10

“env”: {
“ROOT_URL”: “http://your ip or domain name”,
“PORT”: 8061,
“MONGO_URL”: “mongodb://localhost:27017/app name here”,
“MONGO_OPLOG_URL”: “mongodb://localhost:27017/local”
},

and read this