Skip to content

Instantly share code, notes, and snippets.

@kevinohara80
Created December 12, 2012 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinohara80/4270163 to your computer and use it in GitHub Desktop.
Save kevinohara80/4270163 to your computer and use it in GitHub Desktop.
express.js middleware function for checking that the nforce oauth data exists in the user's session.
app.use(function(req, res, next) {
if(!req.session.oauth) res.redirect('/authorize');
else next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment