mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Convert send to TS.
This commit is contained in:
parent
e4c801e823
commit
2172dddd1c
4 changed files with 31 additions and 11 deletions
|
|
@ -8,6 +8,7 @@ import { getAuthToken, parseShareToken } from 'lib/auth';
|
|||
import { secret } from 'lib/crypto';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import { getUser } from '../queries';
|
||||
import { NextApiRequestCollect } from 'pages/api/send';
|
||||
|
||||
const log = debug('umami:middleware');
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ export const useCors = createMiddleware(
|
|||
);
|
||||
|
||||
export const useSession = createMiddleware(async (req, res, next) => {
|
||||
const session = await findSession(req);
|
||||
const session = await findSession(req as NextApiRequestCollect);
|
||||
|
||||
if (!session) {
|
||||
log('useSession: Session not found');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue