Fixed redis lookup.
This commit is contained in:
@@ -61,7 +61,9 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||||||
} else if (redis.enabled && authKey) {
|
} else if (redis.enabled && authKey) {
|
||||||
const key = await redis.client.get(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') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
|||||||
Reference in New Issue
Block a user