var mongoose = require('mongoose') , Schema = mongoose.Schema; var conf = require('./oauth_providers'); var UserSchema = new Schema({}) , User; mongooseAuth = require('mongoose-auth'); UserSchema.plugin(mongooseAuth, { everymodule: { everyauth: { User: function() { return User; } } }, facebook: { everyauth: { myHostname: 'http://local.host:3001', appId: conf.fb.appId, appSecret: conf.fb.appSecret, redirectPath: '/' } }, twitter: { everyauth: { myHostname: 'http://local.host:3001', consumerKey: conf.twit.consumerKey, consumerSecret: conf.twit.consumerSecret, redirectPath: '/' } }, github: { everyauth: { myHostname: 'http://local.host:3001', appId: conf.github.appId, appSecret: conf.github.appSecret, redirectPath: '/' } } }); User = mongoose.model('User', UserSchema); module.exports["User"] = mongoose.model("User"); module.exports["User"].modelName = "User";