mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Implement redux.
This commit is contained in:
parent
9d8a2406e1
commit
5d4ff5cfa4
31 changed files with 341 additions and 85 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import cors from 'cors';
|
||||
import session from './session';
|
||||
import auth from './auth';
|
||||
import { verifySession } from './session';
|
||||
import { verifyAuthToken } from './auth';
|
||||
|
||||
export function use(middleware) {
|
||||
return (req, res) =>
|
||||
|
|
@ -18,7 +18,7 @@ export const useCors = use(cors());
|
|||
|
||||
export const useSession = use(async (req, res, next) => {
|
||||
try {
|
||||
req.session = await session(req);
|
||||
req.session = await verifySession(req);
|
||||
} catch {
|
||||
return res.status(400).end();
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ export const useSession = use(async (req, res, next) => {
|
|||
|
||||
export const useAuth = use(async (req, res, next) => {
|
||||
try {
|
||||
req.auth = await auth(req);
|
||||
req.auth = await verifyAuthToken(req);
|
||||
} catch {
|
||||
return res.status(401).end();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue