mirror of
https://github.com/Foltik/Shimapan
synced 2024-11-10 15:48:27 -05:00
44 lines
757 B
JavaScript
44 lines
757 B
JavaScript
var mongoose = require('mongoose');
|
|
var passportLocalMongoose = require('passport-local-mongoose');
|
|
|
|
var UserSchema = mongoose.Schema({
|
|
username: {
|
|
type: String,
|
|
unique: true,
|
|
required: true
|
|
},
|
|
|
|
displayname: {
|
|
type: String,
|
|
unique: true,
|
|
required: true
|
|
},
|
|
|
|
scope: {
|
|
type: [String],
|
|
required: true
|
|
},
|
|
|
|
uploadCount: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
|
|
uploadSize: {
|
|
type: Number,
|
|
default: 0
|
|
},
|
|
|
|
date: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
});
|
|
|
|
UserSchema.plugin(passportLocalMongoose, {
|
|
saltlen: 64,
|
|
iterations: 10000,
|
|
limitAttempts: true
|
|
});
|
|
|
|
module.exports = mongoose.model('User', UserSchema); |