mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
Update auth logic.
This commit is contained in:
parent
76cad96a24
commit
d2100c33b7
1 changed files with 4 additions and 3 deletions
|
|
@ -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 a new issue