kenshiro-o/login-utils — pull request #3 by amullins83 (2013-06-20 05:39:35+00:00)
Title: Refactored for remote connection support.

Remote Login
--------------------

This refactoring makes login-utils easier to use by automatically connecting to the database at a URL specified by the environment variable `MONGODB_CONNECT`. This has **not** been thoroughly tested, but a quick sanity check using [MongoLab](http://mongolab.com) showed that the basic principle is effective.

If the user environment does not have a `MONGODB_CONNECT` variable set, the default connection URL is "mongodb://127.0.0.1/login-utils-test".

The primary change was to export the Schema objects from each model rather than the models themselves. This way, the models are created on the mongoose object within the `loginChecker

A secondary change was to wrap each library file in a closure with the line `"use strict";` inside. This activates strict mode for each segment individually while preventing errors caused by concatenation with non-strict scripts.