Skip to content

Instantly share code, notes, and snippets.

@royhowie
Last active August 29, 2015 14:22
Show Gist options
  • Save royhowie/34be9b26b2bab4e3aa26 to your computer and use it in GitHub Desktop.
Save royhowie/34be9b26b2bab4e3aa26 to your computer and use it in GitHub Desktop.
how to use a closure
module.exports = {
localLogin: function (passport) {
return passport.authenticate("login", {
successRedirect: "/order/admin",
failureRedirect : "/order/admin/login",
failureFlash : true
})
}
}
var r = require("routing.js")
module.exports = function (app, passport) {
app.get("/login", r.accounts.localLogin(passport))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment