fix trying to get user if there was no jwt subject
This commit is contained in:
parent
54b7e62e94
commit
2e08b35803
@ -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 });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user