Further cleaning and improvements

This commit is contained in:
Luke Berndt
2021-01-26 22:24:04 -05:00
parent 6eebd9cc5e
commit 6f7b86f0cb
44 changed files with 27 additions and 1644 deletions

View File

@@ -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)
})
})

View File

@@ -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) {

View File

@@ -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,

View File

@@ -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
});

View File

@@ -32,10 +32,6 @@ const UserSchema = new mongoose.Schema({
type: Boolean,
default: false
},
customerId: {
type: String,
default: ""
},
confirmEmailToken: String,
confirmEmailTTL: Date,
admin: {