bugfix, warn when no domain set in prod env
This commit is contained in:
parent
28cf479e4b
commit
dd00b85dfc
@ -56,7 +56,14 @@ class Server extends EventEmitter {
|
||||
// Port number is automatically incremented based on shard #
|
||||
this.port = httpOpts.port + this._shardId;
|
||||
// Primarily used by the OAuth methods for the callback url
|
||||
this.domain = NODE_ENV === 'development' ? `localhost:${this.port}` : options.domain;
|
||||
if (NODE_ENV === 'development') {
|
||||
this.domain = `localhost:${this.port}`;
|
||||
} else {
|
||||
if (!options.domain)
|
||||
this.logger.warn('No domain provided in options.json:serverOptions');
|
||||
this.domain = options.domain;
|
||||
}
|
||||
|
||||
this.serveFiles = null; // Holds a reference to the directory from which to serve content
|
||||
if (options.serveFiles)
|
||||
this.serveFiles = path.resolve(options.serveFiles);
|
||||
|
@ -102,7 +102,7 @@ class UserDatabase extends AbstractUserDatabase {
|
||||
if (!username)
|
||||
throw new Error('Missing username');
|
||||
|
||||
let user = this.cache.find(u => u.username.toLowerCase() === username.toLowerCase());
|
||||
let user = this.cache.find(u => u.username?.toLowerCase() === username.toLowerCase());
|
||||
if (user)
|
||||
return Promise.resolve(user);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user