mirror of
https://github.com/arnaucube/commonroutesServer.git
synced 2026-02-28 05:26:42 +01:00
updated
This commit is contained in:
@@ -47,7 +47,9 @@ exports.login = function(req, res) {
|
|||||||
// find the user
|
// find the user
|
||||||
userModel.findOne({
|
userModel.findOne({
|
||||||
username: req.body.username
|
username: req.body.username
|
||||||
}, function(err, user) {
|
})
|
||||||
|
.select('+password')
|
||||||
|
.exec(function(err, user) {
|
||||||
|
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ var mongooseUniqueValidator = require('mongoose-unique-validator');
|
|||||||
|
|
||||||
var userSchema = new Schema({
|
var userSchema = new Schema({
|
||||||
username: { type: String, required: true, unique: true },
|
username: { type: String, required: true, unique: true },
|
||||||
password: { type: String, required: true, selected: false },
|
password: { type: String, required: true, select: false },
|
||||||
token: { type: String, selected: false },
|
token: { type: String, select: false },
|
||||||
description: { type: String, default: "Hello world" },
|
description: { type: String, default: "Hello world" },
|
||||||
avatar: { type: String, default: "img/avatars/racoon.png" },
|
avatar: { type: String, default: "img/avatars/racoon.png" },
|
||||||
faircoin: { type: String, default: "img/faircoinpublickey_sample.png" },
|
faircoin: { type: String, default: "img/faircoinpublickey_sample.png" },
|
||||||
|
|||||||
Reference in New Issue
Block a user