1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-14 00:46:38 -05:00
shimapan/app/models/User.js

34 lines
695 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
},
canonicalname: {
type: String,
unique: true,
required: true
},
2017-10-18 13:31:08 -04:00
scope: [String],
2017-10-14 15:13:50 -04:00
uploadCount: {
type: Number,
default: 0
},
uploadSize: {
type: Number,
default: 0
},
2017-10-11 12:55:46 -04:00
date: Date
2017-10-09 22:01:02 -04:00
});
2018-07-25 18:45:08 -04:00
UserSchema.plugin(passportLocalMongoose, {
usernameField: 'canonicalname',
saltlen: 32,
iterations: 10000,
limitAttempts: true
});
2017-10-09 22:01:02 -04:00
module.exports = mongoose.model('User', UserSchema);