aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/models/User.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/User.js')
-rw-r--r--models/User.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/models/User.js b/models/User.js
index a40ba34..63f2d4a 100644
--- a/models/User.js
+++ b/models/User.js
@@ -158,6 +158,23 @@ UserSchema.methods = {
}
}
+UserSchema.statics = {
+
+ /**
+ * Load user from their email address
+ *
+ * @param {String} email
+ * @param {Function} callback
+ * @api private
+ */
+
+ loadUser: function(email, callback) {
+ this.findOne({ email: email })
+ .exec(callback);
+ }
+
+}
+
mongoose.model('User', UserSchema);