mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01: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);
|
const shareToken = await parseShareToken(req);
|
||||||
|
|
||||||
let user;
|
let user;
|
||||||
if (redis.enabled && !validate(key)) {
|
|
||||||
user = await redis.get(key);
|
if (validate(key)) {
|
||||||
} else {
|
|
||||||
user = await getUser({ id: key });
|
user = await getUser({ id: key });
|
||||||
|
} else if (redis.enabled) {
|
||||||
|
user = await redis.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user && !shareToken) {
|
if (!user && !shareToken) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue