mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Updated prisma and redis clients.
This commit is contained in:
parent
c05d116875
commit
dff105c747
9 changed files with 40 additions and 125 deletions
|
|
@ -2,10 +2,10 @@ import { createMiddleware, unauthorized, badRequest, parseSecureToken } from 'ne
|
|||
import debug from 'debug';
|
||||
import cors from 'cors';
|
||||
import { validate } from 'uuid';
|
||||
import redis from '@umami/redis-client';
|
||||
import { findSession } from 'lib/session';
|
||||
import { getAuthToken, parseShareToken } from 'lib/auth';
|
||||
import { secret } from 'lib/crypto';
|
||||
import redis from 'lib/redis';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { getUser } from '../queries';
|
||||
|
||||
|
|
@ -17,7 +17,7 @@ export const useSession = createMiddleware(async (req, res, next) => {
|
|||
const session = await findSession(req);
|
||||
|
||||
if (!session) {
|
||||
log('useSession:session-not-found');
|
||||
log('useSession: Session not found');
|
||||
return badRequest(res);
|
||||
}
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ export const useAuth = createMiddleware(async (req, res, next) => {
|
|||
log({ token, payload, user, shareToken });
|
||||
|
||||
if (!user && !shareToken) {
|
||||
log('useAuth:user-not-authorized');
|
||||
log('useAuth: User not authorized');
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue