-
-
Save mateodelnorte/ad0fa6009631194ce074 to your computer and use it in GitHub Desktop.
Overriding respondToRegistrationSucceed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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