Fixed redis lookup.

This commit is contained in:
Mike Cao 2023-11-30 22:24:43 -08:00
parent a224a3caf3
commit 3bb82aebd8

View File

@ -61,7 +61,9 @@ export const useAuth = createMiddleware(async (req, res, next) => {
} else if (redis.enabled && authKey) {
const key = await redis.client.get(authKey);
user = await getUserById(key?.userId);
if (key?.userId) {
user = await getUserById(key.userId);
}
}
if (process.env.NODE_ENV === 'development') {