mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Updated CORS options.
This commit is contained in:
parent
3e8dd815b7
commit
48db7708de
@ -3,6 +3,11 @@ import { getSession } from './session';
|
||||
import { getAuthToken } from './auth';
|
||||
import { unauthorized, badRequest, serverError } from './response';
|
||||
|
||||
const corsOptions = {
|
||||
origin: '*',
|
||||
credentials: true,
|
||||
};
|
||||
|
||||
export function createMiddleware(middleware) {
|
||||
return (req, res) =>
|
||||
new Promise((resolve, reject) => {
|
||||
@ -15,7 +20,7 @@ export function createMiddleware(middleware) {
|
||||
});
|
||||
}
|
||||
|
||||
export const useCors = createMiddleware(cors());
|
||||
export const useCors = createMiddleware(cors(corsOptions));
|
||||
|
||||
export const useSession = createMiddleware(async (req, res, next) => {
|
||||
let session;
|
||||
|
Loading…
Reference in New Issue
Block a user