{"_id":"lox","_rev":"40-f1fdc7a50b4ad17b4851cbcfab14c5cc","name":"lox","description":"A tiny mongoose based authentication middleware for Express","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","description":"A tiny mongoose based authentication middleware for Express","tags":["auth","authentication","mongoose","express","expressjs"],"version":"0.1.0","main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0"},"homepage":"http://reaktivo.github.com/lox","_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.1.0","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"f1b1f04dc10df5f888cc4cd6d3242e7c0a76b6d2","tarball":"https://registry.npmjs.org/lox/-/lox-0.1.0.tgz","integrity":"sha512-rqL9mXtJf3XcXIRcLKDsUoTgspo1f1/psTi/L9Nju+fgHJisQDqFW+VHh3wJ7j26EUTNF0q+PSvMfjrSDPyt1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFbU7oi+tPLoYQQHLX81alAXXZA7EOrFtiOrvLJtSkBQAiEA8a5ZFhgBRoswHwf2x3dv3Pp57BoXZFKg6HOWfksyIpk="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.1.2":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","description":"A tiny mongoose based authentication middleware for Express","tags":["auth","authentication","mongoose","express","expressjs"],"version":"0.1.2","main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0"},"homepage":"http://reaktivo.github.com/lox","_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.1.2","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"3fa4f2514566de75c47db841f7717f851a71a546","tarball":"https://registry.npmjs.org/lox/-/lox-0.1.2.tgz","integrity":"sha512-MwRwKG2296MgG3IVMXHVwTVagPaI2QFm6lIHMB1k5xVkg4KIyGHhjnv7opm2XQzj6GEbQerwug6yvFYA1754Pw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZ4/KlshCeHl4ng9UWy8YgQblcomVEiNBlyCe5q5v5ugIhAI5kbFubm82PDKQt8mXLNaCd/YvEMmJFUNJHobtYfMVQ"}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.1.3":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","description":"A tiny mongoose based authentication middleware for Express","tags":["auth","authentication","mongoose","express","expressjs"],"version":"0.1.3","main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0"},"homepage":"http://reaktivo.github.com/lox","_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.1.3","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"cffbc1f086e3cc228533bd8f2494f0253a827b90","tarball":"https://registry.npmjs.org/lox/-/lox-0.1.3.tgz","integrity":"sha512-mDcbDCBonJBdlOwYu5Urane0fi/9r6c7CpWVsSfI1iqhHTexeQNqPFFSf53AjrEE09Ih5Y+6Xt+RTJUW0KszPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+x9aP5JdAHlNfIALAQB7Rtpm0hhy+etvNMHKrtA5xjwIgEwGxPcrJLP/9kVNdkM5sWAaEfsf31LgUVshaoCxX7m8="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.1.4":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.1.4","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0","request":"~2.9.153","express":"~2.5.8"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script"},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.1.4","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"bf0cdc5c2f371cb405b6a36a17e01a81a5d58bea","tarball":"https://registry.npmjs.org/lox/-/lox-0.1.4.tgz","integrity":"sha512-Usp2XdfYCC0Gd3OR16iGgH9xyzN6/FwpqjE97oIn9Nd0TmTCmtrX04qeS2DQN3Z1G3YvsorvKJKAq+dGf2LrCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8W6haRCHC8M1LRFc/Zs7VOWOEMH/SIRi1YkIHhS+DRAiEAyV+VzZ905mue+8BK08eX07Ri8yi03MfLpwS7OT3UwtA="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.0":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.0","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.0","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"ed7c5b4c253b372b85ac3e357dd33bb67ed66da2","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.0.tgz","integrity":"sha512-xfOjOk7GRbOJYNME9FicygtCXtybsM9X+lei/ykUNAr8BH5m2lRffTGmZPjo7og5nnWz+I6ooeUzZ61COkgw0g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIQxoTBq2SyJt8dI+bSOcaQQ8FlYo1T2IC92dBzz4yDAiBUrVLp7DQUssSpT7MRWttkSq0XssNT2aGTvK4PfUWwTw=="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.1":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.1","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.1","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"4c618ed33c8a1f6c1e8c0da64cfd67b04ad36487","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.1.tgz","integrity":"sha512-znj330ECfrGK9qc7vQl78VccqT1loKYnl26dIXgNi5zconvlY3CoR0cOQVu8PKCamKVEDwAARTTF0kFrCriavw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAgTKRDKZaTR6Reiyz/m1fTEme5vqPM+hHczL1QZcGQiAiEA4sYgvLFxOl2uyYUg1NmaygcD3DaBrRlpckiLE0vVUH0="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.2":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.2","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.2","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"4f1a7c25e83540ab1692ae2adcf1c55ab5edb079","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.2.tgz","integrity":"sha512-809LMbxo1yFsqT7jNOiAypMsChVgHeMX+qEBJh72T9f5Ye1msI97jPqaDcQUaagZiQ8vxU4fNYcGzouRM2kjCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTsJPJH5aZNJl+JmK2Vz56HUaA5h2BKrG1+Slx7ZPLygIhAP3j/eSnqKKf/sqldBVJXioQg2HcCPo749iUU5sJMf5n"}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.3":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.3","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.3","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"abe2e573a88dc473dc348116e5a28d4bf41fed23","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.3.tgz","integrity":"sha512-5n8iMxz/QZ6OOYDAp7D8R++TAWDw0Kflmt6eXh2eQIytx+iWH4mMsnpOvJydYPQJKfeqSm5xO7RVnzGJl2vgFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6XPbDKGUqY0LM2DPL1Qx+uL5JtIKulwnpetSGDWow2gIgJ/0w9XUA4MYV8EVsumW/aNAEhEzBpNlUAzrGIR2bO/8="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.4":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.4","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.4","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"c97c0dfdf826dbd7a1a48815b5cb2bfa1c6967ef","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.4.tgz","integrity":"sha512-MfXvcdMj6uAARmLLbMow30Wd3vtRq/MgG/pv+V7Is5+MhsKVGoKjNP3Tt3vgz5ZLHQTXHiokJiTqrlEo9qoBig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfFqlVOwHELuHMI25M9mA+VdFxQ91ieJvZ3lB3osGS8AiEAvr+mUNXldOxhoo9gzlGDNNr6+3X5SrV6sjWCoPau8hw="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.5":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.5","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.5","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"4a7fb9c40439f65025c853ed9bd5c7d5814ec442","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.5.tgz","integrity":"sha512-mfCYiZZHx+WoIwCg6kQxjbC52HBicgW4EOcVagA3smKy0es9JTCEL9cn2pF+ptuAmWTkw0igjzbx2ZVxnTB5tA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDUVHLEvMgweICwqsl0MDFkN1avcPh2HayucxdCkPLfgIhAMgyHq/UeTLfb97pX0DLjd9gTyZkK4gU845j3FlIKhVp"}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.2.6":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.2.6","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"_npmUser":{"name":"reaktivo","email":"m@reaktivo.com"},"_id":"lox@0.2.6","_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"7438cf98aca4151b67a47bf6fc473246f9518c4c","tarball":"https://registry.npmjs.org/lox/-/lox-0.2.6.tgz","integrity":"sha512-9Sl3qSUFaZ27Dmdj+gzuqafQKaHKtw8Nqp2Jn+Peqq6mbFXtdVGNYcc8FFJyP1BOTQd+Prkx8i/RBMDq3zxplw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPf6Pj+Ju5K9YFZceLQxwSvk4l25Yl2KJGJNRyTgPjlwIhAMxkgD2140+9w4cT3o2rhN4P/KNRi3bmsOQNcBEOMO92"}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.3.0":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.3.0","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Version History\n\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.3.0","dist":{"shasum":"1104013b5aa6807b2421cba471bfcb78c3ae67c7","tarball":"https://registry.npmjs.org/lox/-/lox-0.3.0.tgz","integrity":"sha512-38c2405buNBY+SJituyayYYVU/WdXeVHxYuOCNm/gSbmD9n0HVI3SmQv+EZCfnFEp81DFa+9W+/jVPdBEs2deQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHEkgFy+e/XtnczwoKcR/hdw6gvzasOuLIC7dsDMLbnxAiB3c2SGsa5Lw/t3kM0S9WBlcT//Hyp1FBq2nl9SP85PkQ=="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.3.1":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.3.1","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it via Mongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html) or by adding your own fields directly.\n\n    UserSchema = lox.User\n    UserSchena.add {\n      name: String\n      age: Number\n    }\n\n## Version History\n\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.3.1","dist":{"shasum":"4f070780f47f977a5ed3a16b0fe3baa6ec26df22","tarball":"https://registry.npmjs.org/lox/-/lox-0.3.1.tgz","integrity":"sha512-tdwp8UZZ172g//mnz/8ZuEcraO1ErcZq29kAM7X5qYWguzyCEHyUCkxuxSTF09pObTiaesj7Lerf1nHDDC4hvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3asExaMem4/vafZnuBuRJJLCoydnrZO5YSAnhyurU8AiEAkpuPRbpCNPdyCOP5aZhlaJ89TciTe65MZTD7sCsgXbw="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.3.2":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.3.2","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it via Mongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html) or by adding your own fields directly.\n\n    UserSchema = lox.User\n    UserSchena.add {\n      name: String\n      age: Number\n    }\n\n## Version History\n\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.3.2","dist":{"shasum":"ccf1bd12a86543461a1b8fca3321714ddc65a4a7","tarball":"https://registry.npmjs.org/lox/-/lox-0.3.2.tgz","integrity":"sha512-Nj1p5AnstTtNl9QDq1fnSm06AJGGr/kGiuTTb93v+aYm8VZGVp+0Xf9JWJRJ+4f5uY2zbq/xOATQivOlodpUSg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYW9NhDBJ+YZyzaoOj1HglJD9Ma5/djCSlgriphWdNeAIgUQ2fJoxJnLSNASKCD9mKYlQQVJMQDYBUZQfuPcGWaOw="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.3.3":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.3.3","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.5.13","password-hash":"1.1.3"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it via Mongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html) or by adding your own fields directly.\n\n    lox.Schema.add {\n      name: String\n      age: Number\n    }\n\n## Version History\n\n - 0.3.3 Correctly expose User Schema via lox.Schema\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.3.3","dist":{"shasum":"49b7356bb0da5dca4bc2ad4e6c26a425a83ddca4","tarball":"https://registry.npmjs.org/lox/-/lox-0.3.3.tgz","integrity":"sha512-Ht1rObAx1lY7TFnHRbayQOt/2i+1Z1XLie5j3GJm7rLAwuzGZY+E9uJAKXqBMpiFiqJKJQNQ4O4fxVr392Z1UQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3lcqRmaqC+vWV4HsPhF+ejjnW2Sonpka2L/N0ejXFbAiA8BWKINQFhdLcVvaLXjEInWjnVUUeoxz5D424hZ4it+Q=="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.3.4":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.3.4","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.6.8","password-hash":"1.1.3","async":"~0.1.22"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it via Mongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html) or by adding your own fields directly.\n\n    lox.Schema.add {\n      name: String\n      age: Number\n    }\n\n## Version History\n\n - 0.3.4 Updated to latest Mongoose (2.6.8)\n - 0.3.3 Correctly expose User Schema via lox.Schema\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.3.4","dist":{"shasum":"18ed7efb4cc437918215c830db7b06f08edf19ee","tarball":"https://registry.npmjs.org/lox/-/lox-0.3.4.tgz","integrity":"sha512-GINTAmValRQ6S3YdOz9pJo6TA8AGIGnuHgqltIpWEufYQpLv8Zc7xf2wKo2xrww5Y3Nhw+ACuN3Nd6tk0LbsnA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzTYLEX5ItMeEkkxxnZcV5mzFy+F0hsuG7z2qbf8D+0QIgVCti+6fHYllwFqyOmfVuWk49+OccuqmtWgDGqzoRu5c="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.4.0":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.4.0","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.6.8","password-hash":"1.1.3","async":"~0.1.22"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it by passing a second parameter to the lox function, which receives the UserSchema as an argument. For more info check out\nMongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html)\n\n    lox = require 'lox'\n\n    extendFn = (UserSchema) ->\n      UserSchema.add {\n        name: String\n        age: Number\n      }\n\n    app.use lox(mongoDb, extendFn)\n\n## Version History\n\n - 0.4.0 Adds functionality to extend User Schema\n - 0.3.4 Updated to latest Mongoose (2.6.8)\n - 0.3.3 Correctly expose User Schema via lox.Schema\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.4.0","dist":{"shasum":"aedf08108250138531fc9cc31cbdafef19f3d15a","tarball":"https://registry.npmjs.org/lox/-/lox-0.4.0.tgz","integrity":"sha512-teHPojZFREC1uP5DH2W+1eFaOOXZ1V6WOO4JgppQEU37tVg7V+LArVZYtPC/7lh0hJ/2S58iKAkvtiMCX5Vu1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlH39l19AjkydRcSiraHLqXdUPTn4dl4PKRRSF0JbHzAIgdJh/FIP1fSouETJ6/ilNSBDZEh3ukKEtBGsQWe5sZ6I="}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]},"0.4.1":{"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"name":"lox","version":"0.4.1","description":"A tiny mongoose based authentication middleware for Express","homepage":"http://reaktivo.github.com/lox","tags":["auth","authentication","mongoose","express","expressjs"],"main":"./lib/lox","repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"engines":{"node":"~0.6.2"},"dependencies":{"mongoose":"2.6.8","password-hash":"1.1.3","async":"~0.1.22"},"devDependencies":{"coffee-script":"1.2.0","mocha":"~1.0.0"},"scripts":{"pretest":"cake build","prepublish":"cake build","test":"mocha --compilers coffee:coffee-script --reporter spec --no-colors"},"optionalDependencies":{},"readme":"# Lox\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\nIt tries to provide the minimum set of features to handle user authentication.\nLox is written in coffeescript by [Marcel Miranda](http://reaktivo.com).\n\n[Source Code](https://github.com/reaktivo/lox) - [Documentation](http://reaktivo.github.com/lox/)\n\n\n## Installation\n\n    npm install lox\n\n\n## Usage\n\n    # Create express app\n    app = express.createServer()\n\n    # Make sure to add the session middleware\n    app.use express.session(secret: \"234asldkn2naodufnu4n\")\n\n    # Create an instance of mongoose\n    mongoose = require 'mongoose'\n    mongoDb = mongoose.createConnection 'mongodb://user:password@staff.mongohq.com:1234/whatever'\n\n    # Then use the lox middleware\n    app.use lox(mongoDb)\n\n    # or just pass a mongodb connection string directly\n    app.use lox('mongodb://user:password@staff.mongohq.com:1234/whatever')\n\n    # Create a user\n    lox.create email, password, (err) ->\n      # err != undefined if user could not be created\n\n    # Delete a user\n    lox.destroy email, (err, user) ->\n      # user.lastWords()\n\n    # Get list of all users\n    lox.find (err, users) ->\n      # do something with users array\n\n    # Get access to logged in user\n    app.get '/who', (req, res) ->\n      res.send req.user or \"No user logged in\"\n\n    # You can also access the user from a view\n    # via the 'user' local\n\n\n    # Create session (login)\n    app.post '/login', (req, res, next) ->\n      email = req.body.email\n      password = req.body.password\n      req.login email, password, (err, user) ->\n        if user then res.send \"logged in as #{user.email}\"\n        else res.send  \"not logged in\"\n\n    # Destroy session (logout)\n    app.get '/logout', (req, res, next) ->\n      req.logout -> res.redirect '/'\n\n\n\n## Login and logout for the lazy\n\nLox also provides login and logout middleware so you can quickly add it to your express project.\n\n    # Both the login and logout handlers receive\n    # parameters for uri's to redirect to if\n    # attempt is successful or failure.\n\n    # Login\n    app.post \"/login\", lox.routes.login(\"/success_uri\", \"/fail_uri\")\n\n    # Logout\n    app.get \"/logout\", lox.routes.logout(\"/success_uri\", \"/fail_uri\")\n\n\n## Extending the User Model\n\nThe default User model that comes with lox only contains the `email` and `password` fields with corresponding validation and hashing features.\nYou can extend it by passing a second parameter to the lox function, which receives the UserSchema as an argument. For more info check out\nMongoose's [plugin functionality](http://mongoosejs.com/docs/plugins.html)\n\n    lox = require 'lox'\n\n    extendFn = (UserSchema) ->\n      UserSchema.add {\n        name: String\n        age: Number\n      }\n\n    app.use lox(mongoDb, extendFn)\n\n## Version History\n\n - 0.4.1 Force trimmed and lowercased email\n - 0.4.0 Adds functionality to extend User Schema\n - 0.3.4 Updated to latest Mongoose (2.6.8)\n - 0.3.3 Correctly expose User Schema via lox.Schema\n - 0.3.1 Fixed error requiring db\n - 0.3.0 Allows sharing a mongoose instance when calling the lox method\n\n\n## Testing\n\nLox is written in coffeescript, so if you want to contribute, build your js and then test so you don't break anything.\nTests use mocha, so make sure you install developer dependencies beforehand.\n\n    npm install --dev\n    npm test\n\nYou can checkout the latest build status at [Travis CI](http://travis-ci.org/#!/reaktivo/lox).\n\n## Contributing to lox\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","_id":"lox@0.4.1","dist":{"shasum":"4420c5c7b56730dca1e0ba7371a943f92587d3d3","tarball":"https://registry.npmjs.org/lox/-/lox-0.4.1.tgz","integrity":"sha512-3qx14NldLqQzv2icbYX8pxj4qaCM/j6N0aXuKwJQIiB8lYr5HzlRqBh4KGhcktlHQ2sKjsS29R0+X/r0LN7zgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4Y7eJOx+fxIZD+4TjpkLT1Ap8CPqGky4MLrc2tmu0DAIhAMbZGjOPYI347UpzKocW103BxP2MOVjVWWuTvM1kwHHt"}]},"maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}]}},"readme":"Lox\n========================\n\n[![Build Status](https://secure.travis-ci.org/reaktivo/lox.png)](http://travis-ci.org/reaktivo/lox)\n\nLox is a tiny mongoose based authentication middleware for [Express](http://expressjs.com).\n\nLox is written in coffeescript\n\nInstallation\n------------\n\n`npm install lox`\n\n\nUsage\n-----\n```coffee-script\n# Start by adding as Express middleware\nmongoDb = 'mongodb://user:password@staff.mongohq.com:1234/whatever'\napp = express.createServer()\n# Make sure to add it after session middleware\napp.use express.session(secret: \"234asldkn2naodufnu4n\")\napp.use lox.middleware(mongoDb)\n\n# Create a user\nlox.create email, password, (err) ->\n  # err != undefined if user could not be created\n\n# Delete a user\nlox.destroy email, (err, user) ->\n  # user.lastWords()\n\n# Get list of all users\nlox.find (err, users) ->\n  # do something with users array\n\n# Get access to logged in user\napp.get '/who', (req, res) ->\n  res.send req.user or \"No user logged in\"\n\n# Create session (login)\napp.get '/login', (req, res, next) ->\n  email = req.params.email\n  password = req.params.password\n  req.login email, password, (err, user) ->\n    if user then res.send \"logged in as #{user.email}\"\n    else res.send  \"not logged in\"\n\n# Destroy session (logout)\napp.get '/logout', (req, res, next) ->\n  req.logout -> res.redirect '/'\n```\n\nContributing to lox\n-------------------\n\n - Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet\n - Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it\n - Fork the project\n - Start a feature/bugfix branch\n - Commit and push until you are happy with your contribution\n - Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.\n\n\nCopyright © 2012 Marcel Miranda. See LICENSE for further details.","maintainers":[{"name":"reaktivo","email":"m@reaktivo.com"}],"time":{"modified":"2022-06-19T14:26:30.643Z","created":"2012-03-29T12:29:30.931Z","0.1.0":"2012-03-29T12:29:32.044Z","0.1.2":"2012-03-29T18:37:48.413Z","0.1.3":"2012-03-29T18:39:44.215Z","0.1.4":"2012-03-30T07:19:54.132Z","0.2.0":"2012-03-31T00:37:15.645Z","0.2.1":"2012-03-31T02:26:00.192Z","0.2.2":"2012-05-01T02:30:32.139Z","0.2.3":"2012-05-01T02:33:09.557Z","0.2.4":"2012-05-01T03:11:56.728Z","0.2.5":"2012-05-01T03:13:20.945Z","0.2.6":"2012-05-01T03:24:03.888Z","0.3.0":"2012-07-10T23:02:24.065Z","0.3.1":"2012-07-10T23:46:00.900Z","0.3.2":"2012-07-11T02:20:59.001Z","0.3.3":"2012-07-11T03:06:09.730Z","0.3.4":"2012-07-14T03:30:53.065Z","0.4.0":"2012-07-31T00:00:28.380Z","0.4.1":"2012-08-01T02:00:56.615Z"},"author":{"name":"Marcel Miranda","email":"m@reaktivo.com","url":"http://reaktivo.com"},"repository":{"type":"git","url":"git://github.com/reaktivo/lox.git"},"users":{"fgribreau":true}}