Fixed breaking syntax error with genRandomId function selection.

This commit is contained in:
Eden Tyler-Moss 2020-01-31 10:34:35 +00:00
parent 2eb7f9cfb1
commit 2a5d0b9cc3
2 changed files with 3 additions and 5 deletions

View File

@ -6,9 +6,7 @@ module.exports = ({ config, realm }) => {
// Retrieve guaranteed random ID. // Retrieve guaranteed random ID.
app.get('/id', (req, res) => { app.get('/id', (req, res) => {
res.contentType = 'text/html'; res.contentType = 'text/html';
res.send(realm.generateClientId( res.send(realm.generateClientId(config.genRandomId));
config.genRandomId ? config.genRandomId : undefined
));
}); });
// Get a list of all peers for a key, enabled by the `allowDiscovery` flag. // Get a list of all peers for a key, enabled by the `allowDiscovery` flag.

View File

@ -48,8 +48,8 @@ class Realm {
} }
const genRandomId = _genRandomId && typeof _genRandomId === 'function' ? const genRandomId = _genRandomId && typeof _genRandomId === 'function' ?
() => _genRandomId : _genRandomId :
() => originalGenRandomId; originalGenRandomId;
let clientId = genRandomId(); let clientId = genRandomId();