Skip to content

Instantly share code, notes, and snippets.

@ryancole
Created January 11, 2012 21:45
Show Gist options
  • Save ryancole/1596929 to your computer and use it in GitHub Desktop.
Save ryancole/1596929 to your computer and use it in GitHub Desktop.
exports.signin_p = (req, res) ->
spec =
username: req.body.account.username
password: req.body.account.password
models.account.authenticate spec, (err, account) ->
if not account
res.redirect 'back'
req.session.regenerate ->
req.session.account = account
res.redirect '/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment