Password Policy/App rename/PM Scheduling Improvements
This commit is contained in:
@@ -12,7 +12,7 @@ function isLocalDevOrigin(origin) {
|
||||
|
||||
function createCorsMiddleware() {
|
||||
const persistedCors = one('SELECT value FROM app_settings WHERE key = ?', ['cors_allowed_domains'])?.value || '';
|
||||
const allowedOrigins = (process.env.MIXEDASSETS_CORS_ORIGINS || persistedCors || 'http://localhost:5173,http://127.0.0.1:5173')
|
||||
const allowedOrigins = (process.env.DEPRECORE_CORS_ORIGINS || persistedCors || 'http://localhost:5173,http://127.0.0.1:5173')
|
||||
.split(',')
|
||||
.map((origin) => origin.trim())
|
||||
.filter(Boolean);
|
||||
@@ -20,7 +20,7 @@ function createCorsMiddleware() {
|
||||
return cors({
|
||||
origin(origin, callback) {
|
||||
if (!origin || allowedOrigins.includes(origin) || isLocalDevOrigin(origin)) return callback(null, true);
|
||||
return callback(new Error('Origin is not allowed by MixedAssets CORS settings'));
|
||||
return callback(new Error('Origin is not allowed by DepreCore CORS settings'));
|
||||
},
|
||||
credentials: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user