Skip to content
Snippets Groups Projects
Commit c6c07e46 authored by Yannis Barlas's avatar Yannis Barlas
Browse files

fix(server): fix crash when trying to read empty config values

parent 498e7a55
Branches master
No related tags found
No related merge requests found
......@@ -57,14 +57,19 @@ const configureApp = app => {
}
// Allow CORS from client if host / port is different
app.use(
cors({
origin: `${config.get('pubsweet-client.host')}:${config.get(
'pubsweet-client.port',
)}`,
credentials: true,
}),
)
if (
config.has('pubsweet-client.host') &&
config.has('pubsweet-client.port')
) {
app.use(
cors({
origin: `${config.get('pubsweet-client.host')}:${config.get(
'pubsweet-client.port',
)}`,
credentials: true,
}),
)
}
// Register passport authentication strategies
app.use(passport.initialize())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment