mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Update auth logic.
This commit is contained in:
parent
76cad96a24
commit
d2100c33b7
@ -30,10 +30,11 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
||||
const shareToken = await parseShareToken(req);
|
||||
|
||||
let user;
|
||||
if (redis.enabled && !validate(key)) {
|
||||
user = await redis.get(key);
|
||||
} else {
|
||||
|
||||
if (validate(key)) {
|
||||
user = await getUser({ id: key });
|
||||
} else if (redis.enabled) {
|
||||
user = await redis.get(key);
|
||||
}
|
||||
|
||||
if (!user && !shareToken) {
|
||||
|
Loading…
Reference in New Issue
Block a user