mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Refactored queries.
This commit is contained in:
parent
f36a689817
commit
8904b7b4ed
27 changed files with 137 additions and 144 deletions
|
|
@ -12,7 +12,7 @@ import { findSession } from 'lib/session';
|
|||
import { getAuthToken, parseShareToken } from 'lib/auth';
|
||||
import { secret, isUuid } from 'lib/crypto';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { getUser } from '../queries';
|
||||
import { getUserById } from '../queries';
|
||||
import { NextApiRequestCollect } from 'pages/api/send';
|
||||
|
||||
const log = debug('umami:middleware');
|
||||
|
|
@ -53,7 +53,7 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
const { userId, authKey } = payload || {};
|
||||
|
||||
if (isUuid(userId)) {
|
||||
user = await getUser({ id: userId });
|
||||
user = await getUserById(userId);
|
||||
} else if (redis.enabled && authKey) {
|
||||
user = await redis.get(authKey);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue