nl_tokens: Handle Login attempts redirect on success render Login with error on failure
pl_tokens: function attemptLogin ( req , res ) { var username = req . param ( 'username' ) , password = req . param ( 'password' ) , <mask> = req . param ( 'next' , '/' ) ; authdb . validate ( username , password , function ( err , valid ) { if ( valid ) { req . session . authed = true ; req . session . username = username ; res . redirect ( next ) ; } else { res . emsg = 'Invalid Username or Password' ; render ( req , res , 'login.jade' , { next : next } ) ; } } ) ; }