Skip to content

Commit

Permalink
fix: allow logging in when using production mode locally
Browse files Browse the repository at this point in the history
It hasn't been possible to log in when running production mode locally. I've just discovered that it's the use of NODE_ENV causing broken configuration when not running the site on a prereview.org domain. 66f2dfd had caused the NODE_ENV to be 'production' locally.

Using the NODE_ENV to change settings will always create problems; instead, we can calculate the setting based on the ORCID callback URL, which will work no matter where we run the site.

Refs #395
  • Loading branch information
thewilkybarkid committed Aug 23, 2021
1 parent 636412b commit db0815f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default async function configServer(config) {
}

// Manual override of domain to allow for outbreaksci.* subdomain
const sessionOpts = config.isProd ? { domain: 'prereview.org' } : {};
const sessionOpts = { domain: new URL(config.orcidCallbackUrl).hostname };

server
.use(compress())
Expand Down

0 comments on commit db0815f

Please sign in to comment.