mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 10:32:31 +00:00
13 lines
318 B
CoffeeScript
13 lines
318 B
CoffeeScript
|
mongojs = require("../../infrastructure/mongojs")
|
||
|
db = mongojs.db
|
||
|
ObjectId = mongojs.ObjectId
|
||
|
|
||
|
module.exports =
|
||
|
|
||
|
findByEmail: (email, callback)->
|
||
|
email = email.trim()
|
||
|
db.users.findOne email:email, (err, user)->
|
||
|
callback(err, user)
|
||
|
|
||
|
findById: (_id, callback)->
|
||
|
db.users.findOne _id:ObjectId(_id+""), callback
|