mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Fixed share token check.
This commit is contained in:
parent
091716e037
commit
8722b794d9
2 changed files with 6 additions and 9 deletions
|
|
@ -29,12 +29,12 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
const payload = parseSecureToken(token, secret());
|
||||
const shareToken = await parseShareToken(req);
|
||||
|
||||
let user;
|
||||
let user = null;
|
||||
const { userId, key } = payload || {};
|
||||
|
||||
if (validate(userId)) {
|
||||
user = await getUser({ id: userId });
|
||||
} else if (redis.enabled) {
|
||||
} else if (redis.enabled && key) {
|
||||
user = await redis.get(key);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue