From 19dd5a2a9d1f7484cdfc980126d046b40b72bd5f Mon Sep 17 00:00:00 2001 From: Kgothatso Date: Sun, 1 Dec 2019 00:08:06 +0200 Subject: [PATCH] Prefer url over domain --- lib/commands/authenticate-challenge.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/commands/authenticate-challenge.js b/lib/commands/authenticate-challenge.js index 2d128e8..dadc73a 100644 --- a/lib/commands/authenticate-challenge.js +++ b/lib/commands/authenticate-challenge.js @@ -12,8 +12,8 @@ module.exports.builder = (yargs) => { describe: 'challenge that needs to be signed', type: 'string' }) - .option('domain-url', { - describe: 'override domain url belong to the service making the challenge', + .option('url', { + describe: 'override url belong to the service making the challenge', type: 'string' }) .option('user-identifier', { @@ -28,17 +28,17 @@ module.exports.handler = (argv) => { const challenge = JSON.parse(argv.challenge); // TODO get userIdentifier and domainUrl from challenge const loginRequest = JSON.parse(challenge.message); - const domainUrl = argv.domainUrl || loginRequest.domainUrl; + const url = argv.url || loginRequest.url; const userIdentifier = argv.userIdentifier || loginRequest.userIdentifier; persistence().LoadDB() .then(db => { console.log("Looking for"); - console.log("url: ", domainUrl); + console.log("url: ", url); console.log("userIdentifier: ", userIdentifier); return db.Lock.findOne({ where: { - url: domainUrl, + url: url, userIdentifier: userIdentifier }, include: [