소스 검색

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