Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2012 13:28
What would you like to do?
//FIXME: validate user input somewhere
function getAuthParams(req) {
//1. check `authuser` and `authpass` request query parameter
//2. check `authuser` and `authpass` request body properties
var user = req.query.authuser || req.body.authuser,
pass = req.query.authpass || req.body.authpass;
if (user && pass) return {
user: user,
pass: pass
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment