Created
June 17, 2012 13:28
-
-
Save tommedema/2944566 to your computer and use it in GitHub Desktop.
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
//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