const mongoose = require('mongoose');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const UserSchema = new mongoose.Schema({
UserSchema.pre('save', async function(next) {
const salt = await bcrypt.genSalt(10);
UserSchema.methods.comparePassword = async function(candidatePassword) {
module.exports = mongoose.model('User', UserSchema);