mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 16:57:39 -05:00
Further cleaning and improvements
This commit is contained in:
@@ -11,15 +11,11 @@ module.exports = function (app, passport) {
|
||||
// serializing, and querying the user record by ID from the database when
|
||||
// deserializing.
|
||||
passport.serializeUser((user, done) => {
|
||||
console.log("passport.serializeUser() - Serializing the user: " + user.id);
|
||||
done(null, user.id)
|
||||
})
|
||||
|
||||
passport.deserializeUser((id, done) => {
|
||||
console.log("passport.deserializeUser() - Trying to deSerialize the user: " + id);
|
||||
User.findById(id, (err, user) => {
|
||||
console.log("passport.deserializeUser() - Found the user: " + user);
|
||||
console.log("passport.deserializeUser() - Err: " + err);
|
||||
done(err, user)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -50,7 +50,6 @@ exports.listSystems = function (req, res, next) {
|
||||
country,
|
||||
userId,
|
||||
key,
|
||||
planType,
|
||||
showScreenName
|
||||
}) => ({
|
||||
name,
|
||||
@@ -63,7 +62,6 @@ exports.listSystems = function (req, res, next) {
|
||||
country,
|
||||
userId,
|
||||
key,
|
||||
planType,
|
||||
showScreenName
|
||||
}))(obj);
|
||||
if (obj.showScreenName) {
|
||||
|
||||
@@ -134,7 +134,6 @@ function isAdmin(req, res, next) {
|
||||
}
|
||||
|
||||
function isLoggedIn(req, res, next) {
|
||||
console.log(req)
|
||||
if (req.isAuthenticated()) return next();
|
||||
res.status(401).send({
|
||||
success: false,
|
||||
|
||||
@@ -11,7 +11,6 @@ var systemSchema = mongoose.Schema({
|
||||
state: String,
|
||||
description: String,
|
||||
showScreenName: Boolean,
|
||||
planType: {type: Number, default: 0},
|
||||
userId: mongoose.Schema.Types.ObjectId,
|
||||
key: String
|
||||
});
|
||||
|
||||
@@ -32,10 +32,6 @@ const UserSchema = new mongoose.Schema({
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
customerId: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
confirmEmailToken: String,
|
||||
confirmEmailTTL: Date,
|
||||
admin: {
|
||||
|
||||
Reference in New Issue
Block a user