mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Merged #1752.
This commit is contained in:
parent
3acff56a59
commit
a430eae12b
1 changed files with 6 additions and 1 deletions
|
|
@ -3,7 +3,12 @@ import cors from 'cors';
|
||||||
import { getSession } from './session';
|
import { getSession } from './session';
|
||||||
import { getAuthToken, getShareToken } from './auth';
|
import { getAuthToken, getShareToken } from './auth';
|
||||||
|
|
||||||
export const useCors = createMiddleware(cors());
|
export const useCors = createMiddleware(
|
||||||
|
cors({
|
||||||
|
// Cache CORS preflight request 24 hours by default
|
||||||
|
maxAge: process.env.CORS_MAX_AGE || 86400,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
export const useSession = createMiddleware(async (req, res, next) => {
|
export const useSession = createMiddleware(async (req, res, next) => {
|
||||||
let session;
|
let session;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue