How do I make 2 level user authentication (similar to how you log in on Slack) for a Meteor application?


#1

So I asked this same question on StackOverflow (http://stackoverflow.com/questions/29691074/how-to-add-2-level-user-authentication-to-meteor-application/29699662#29699662) and I wasn’t getting the answers I was really looking for. I just want the user to experience two login sessions. One session where they log in with a common username/password and the second where they log in to access their personal account using personal credentials such as email/password. Some people suggested that I just use group permissions, and have a section where the user can see a list of all the groups they can belong to. However I don’t want to do this right now, because it would mean I would have to re-think the entire logic behind the app and tear everything up that I had worked so hard on and start from scratch. Although group permissions would be awesome to implement in future releases, I just want to quickly make an app with the above requirements. Anyways the meat of the question is as follows.
For a Meteor app I am writing, I want to have two levels of user authentication. On the first level, the user will log in to a group using a username and password (which is shared amongst many people who belong to the group). On the second level, the user will log in to their own personal account that is within the said group using their email and password.
I already have a system developed for getting a user to sign in to their personal account (using email/password), but I am confused as to how to add a feature so that each user belongs to a specific group.
A similar example would be a login system similar to slack. Where you login with the group name, then sign in to your profile. If authenticated (i.e. your credentials say your email/password is correct + you belong to the group) you can start using the application.
I feel as though the solution is very simple, I tried to use accounts-ui element {{> loginButtons}} but it only worked on the second level (could only log user into their profile, and could not have users log into different groups)
I think my problem may be where I am inserting the said element, or it may be that meteor doesn’t allow you to use multiple instances of user authentication.
I am looking for some clarification on my problem, any help would be greatly appreciated!