Skip to content

Commit

Permalink
fix(server): swap configure preference, debug migration missing on db
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Aug 28, 2024
1 parent 4e0e98d commit fa0e846
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/server/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ export default function serverAuth(

const csrfCookie = csrfRes?.headers.get('set-cookie');

if (!credentials) {
throw new Error(
'Unable to obtain credential provider. Aborting server side login.'
);
}
const signInUrl = new URL(credentials.callbackUrl);

if (!csrfCookie) {
Expand Down
14 changes: 9 additions & 5 deletions packages/server/src/utils/Config/envVars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,20 @@ export const getControlPlane = (cfg: EnvConfig) => {
const { config, logger } = cfg;
const { info } = Logger(config, '[basePath]');

if (config?.configureUrl) {
logger && info(logger, 'config', config.configureUrl);
return config.configureUrl;
}

if (process.env.NILEDB_CONFIGURE) {
logger && info(logger, 'NILEDB_CONFIGURE', process.env.NILEDB_CONFIGURE);
// backwards compatible, but not really
if (!process.env.NILEDB_CONFIGURE.startsWith('http')) {
return `https://${process.env.NILEDB_CONFIGURE}`;
}
return process.env.NILEDB_CONFIGURE;
}

if (config?.configureUrl) {
logger && info(logger, 'NILEDB_CONFIGURE', config.configureUrl);
return config.configureUrl;
}

logger && info(logger, 'default', 'https://global.thenile.dev');
return 'https://global.thenile.dev';
};
Expand Down

0 comments on commit fa0e846

Please sign in to comment.