]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/models/user.js
1 const mongoose
= require('mongoose')
3 // ---------------------------------------------------------------------------
5 const UserSchema
= mongoose
.Schema({
10 UserSchema
.path('password').required(true)
11 UserSchema
.path('username').required(true)
13 UserSchema
.statics
= {
14 getByUsernameAndPassword: getByUsernameAndPassword
,
18 mongoose
.model('User', UserSchema
)
20 // ---------------------------------------------------------------------------
22 function list (callback
) {
23 return this.find(callback
)
26 function getByUsernameAndPassword (username
, password
) {
27 return this.findOne({ username: username
, password: password
})