I'm working on authentication system for my website. I currently am working with the naive MongoDB driver for node, and my own custom authentication system, but I'm looking to switch over to the mongoose abstraction and the everyauth system, because I want users to be able to log in with different methods, such as Facebook.
Here's my register route:
AM = require('../modules/account-manager')
routes = (app) ->
app.get '/register', (req, res) ->
res.render "#{__dirname}/views/register",
title: 'Register | WebSite Title'
stylesheet: 'register'
app.post '/register', (req, res) ->
AM.addNewAccount({
name : req.param('name'),
email : req.param('email'),
user : req.param('user'),
pass : req.param('pass'),
}, (e) ->
if e
res.send(e, 400)
else
res.redirect '/home'
)
module.exports = routes
My question is whether or not anybody has any good references or tutorials or example code for this, as I am fairly new to node. I Have searched extensively online but have been unable to find anything.
Thanks - CB
did you have a look at the github repo for everyauth as it seems to have pretty decent documentation and also an example folder with code.