Hi I am using the express framework to make a site in node. I am trying to use facebox to present a box where a use can login so that the music on the site will not have to stop playing.
I am using mongoose-auth/everyauth for authentication and can't figure out how this can be done.
I need to be able to render the login page as a partial I believe. I have the following: I think using loginLocals is the answer?
Anyone have any idea!?
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, mongooseAuth = require('mongoose-auth');
var everyauth = require('everyauth')
, Promise = everyauth.Promise;
var UserSchema = new Schema({});
UserSchema.plugin(mongooseAuth, {
everymodule: {
everyauth: {
User: function () {
return User;
}
}
},
password: {
loginWith: 'email'
, extraParams: {
genre: String
}
, everyauth: {
getLoginPath: '/login'
, postLoginPath: '/login'
, loginView: 'login.jade'
, getRegisterPath: '/register'
, postRegisterPath: '/register'
, registerView: 'register.jade'
, loginSuccessRedirect: '/'
, registerSuccessRedirect: '/'
, loginLocals: function(req, res) {
//console.log("ASD");
return res.partial('toop');
}
}
}
});