Skip to content

Instantly share code, notes, and snippets.

@mateodelnorte
Created September 14, 2011 22:40
Show Gist options
  • Save mateodelnorte/ad0fa6009631194ce074 to your computer and use it in GitHub Desktop.
Save mateodelnorte/ad0fa6009631194ce074 to your computer and use it in GitHub Desktop.
Overriding respondToRegistrationSucceed
var mongooseAuth = require('mongoose-auth');
UserSchema.plugin(mongooseAuth, {
everymodule: {
everyauth: {
User: function () {
return User;
}
}
}
, password: {
loginWith: 'login'
, extraParams: {
email: mongoose.SchemaTypes.Email
, twitterScreenName: String
, name: {
first: String
, last: String
}
}
, everyauth: {
getLoginPath: '/login'
, postLoginPath: '/login'
, loginView: 'login.jade'
, getRegisterPath: '/register'
, postRegisterPath: '/register'
, registerView: 'register.jade'
, loginSuccessRedirect: '/crowd'
, registerSuccessRedirect: '/crowd'
, respondToRegistrationSucceed:
function (res, user) {
console.log('respondToRegistrationSucceed overrided');
res.writeHead(303, {'Location': this.registerSuccessRedirect()});
res.end();
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment