Procházet zdrojové kódy

fix trying to get user if there was no jwt subject

Pouria Ezzati před 1 rokem
rodič
revize
2e08b35803
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      server/passport.js

+ 1 - 1
server/passport.js

@@ -17,7 +17,7 @@ passport.use(
     try {
     try {
       // 'sub' used to be the email address
       // 'sub' used to be the email address
       // this check makes sure to invalidate old JWTs where the sub is still the email address
       // this check makes sure to invalidate old JWTs where the sub is still the email address
-      if (typeof payload.sub === "string") {
+      if (typeof payload.sub === "string" || !payload.sub) {
         return done(null, false);
         return done(null, false);
       }
       }
       const user = await query.user.find({ id: payload.sub });
       const user = await query.user.find({ id: payload.sub });