1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-11 07:54:55 -05:00
shimapan/app/models/User.js

44 lines
757 B
JavaScript
Raw Normal View History

2017-10-09 22:01:02 -04:00
var mongoose = require('mongoose');
2017-10-18 13:31:08 -04:00
var passportLocalMongoose = require('passport-local-mongoose');
2017-10-09 22:01:02 -04:00
var UserSchema = mongoose.Schema({
username: {
type: String,
unique: true,
required: true
},
displayname: {
type: String,
unique: true,
required: true
},
scope: {
type: [String],
required: true
},
2017-10-14 15:13:50 -04:00
uploadCount: {
type: Number,
default: 0
},
2017-10-14 15:13:50 -04:00
uploadSize: {
type: Number,
default: 0
},
date: {
type: Date,
default: Date.now
}
2017-10-09 22:01:02 -04:00
});
2018-07-25 18:45:08 -04:00
UserSchema.plugin(passportLocalMongoose, {
saltlen: 64,
2018-07-25 18:45:08 -04:00
iterations: 10000,
limitAttempts: true
});
2017-10-09 22:01:02 -04:00
module.exports = mongoose.model('User', UserSchema);