Somewhat prettier css

This commit is contained in:
Kasper Rynning-Tønnesen
2019-07-26 10:23:55 +02:00
parent 6289f73844
commit bcb5641f90
28 changed files with 10802 additions and 8986 deletions

View File

@@ -1,24 +1,24 @@
// app/models/user.js
// load the things we need
var mongoose = require('mongoose');
var bcrypt = require('bcrypt-nodejs');
var mongoose = require("mongoose");
var bcrypt = require("bcrypt-nodejs");
// define the schema for our user model
var userSchema = mongoose.Schema({
username : String,
password : String,
username: String,
password: String
});
// methods ======================
// generating a hash
userSchema.methods.generateHash = function(password) {
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};
// checking if password is valid
userSchema.methods.validPassword = function(password) {
return bcrypt.compareSync(password, this.password);
return bcrypt.compareSync(password, this.password);
};
// create the model for users and expose it to our app
module.exports = mongoose.model('User', userSchema);
module.exports = mongoose.model("User", userSchema);