{"action":"closed","issue":{"url":"https://api.github.com/repos/saintedlama/passport-local-mongoose/issues/95","labels_url":"https://api.github.com/repos/saintedlama/passport-local-mongoose/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/saintedlama/passport-local-mongoose/issues/95/comments","events_url":"https://api.github.com/repos/saintedlama/passport-local-mongoose/issues/95/events","html_url":"https://github.com/saintedlama/passport-local-mongoose/issues/95","id":103155385,"number":95,"title":"Two models based on two separate schemas.","user":{"login":"DanielDeychakiwsky","id":6568233,"avatar_url":"https://avatars.githubusercontent.com/u/6568233?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielDeychakiwsky","html_url":"https://github.com/DanielDeychakiwsky","followers_url":"https://api.github.com/users/DanielDeychakiwsky/followers","following_url":"https://api.github.com/users/DanielDeychakiwsky/following{/other_user}","gists_url":"https://api.github.com/users/DanielDeychakiwsky/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielDeychakiwsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielDeychakiwsky/subscriptions","organizations_url":"https://api.github.com/users/DanielDeychakiwsky/orgs","repos_url":"https://api.github.com/users/DanielDeychakiwsky/repos","events_url":"https://api.github.com/users/DanielDeychakiwsky/events{/privacy}","received_events_url":"https://api.github.com/users/DanielDeychakiwsky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-26T02:15:17Z","updated_at":"2015-08-26T13:39:30Z","closed_at":"2015-08-26T13:39:30Z","body":"Hi,\r\n\r\nThis module is fantastic. \r\n\r\nI have two mongoose schemas for two separate users. The schemas contain different data from each other, this wasn't as simple as using the concept of \"roles\". \r\n\r\nIs there a way to use passport-local-mongoose with two different models? When I require in the module, it is a singleton (from require)....\r\n\r\nFor instance:\r\n\r\n```\r\n// requires the model with Passport-Local Mongoose plugged in\r\nvar User = require('./models/user');\r\n\r\n// TODO: Auth this user-type as well\r\nvar User2 = require('./modles/user2'); \r\n\r\n// use static authenticate method of model in LocalStrategy\r\npassport.use(new LocalStrategy(User.authenticate()));\r\n\r\n// use static serialize and deserialize of model for passport session support\r\npassport.serializeUser(User.serializeUser());\r\npassport.deserializeUser(User.deserializeUser());\r\n```"}}