Преглед изворни кода

fix trying to get user if there was no jwt subject

Pouria Ezzati пре 1 година
родитељ
комит
2e08b35803
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      server/passport.js

+ 1 - 1
server/passport.js

@@ -17,7 +17,7 @@ passport.use(
     try {
       // 'sub' used to be 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);
       }
       const user = await query.user.find({ id: payload.sub });