Introduce a few user arguments
This commit is contained in:
parent
04d7675c20
commit
2d9705577c
@ -13,6 +13,10 @@ module.exports.builder = (yargs) => {
|
||||
describe: 'Challenge to sign',
|
||||
type: 'string'
|
||||
})
|
||||
.option('p', {
|
||||
describe: 'will post signature to response endpoint',
|
||||
type: 'boolean'
|
||||
})
|
||||
.demandOption(['challenge'])
|
||||
.argv;
|
||||
}
|
||||
|
@ -50,10 +50,12 @@ module.exports.authenticate = function(challenge, authenticationRequest, argv) {
|
||||
const signature = cryptoUtil.signMessage(walletXpriv, challengeDerivationPath, challenge.message).toString('hex');
|
||||
console.log("Signature: ", signature);
|
||||
|
||||
postSignature.postSignature(authenticationRequest.responseEndpoint, {
|
||||
id: challenge.id,
|
||||
signature: signature
|
||||
})
|
||||
if(argv.p) {
|
||||
postSignature.postSignature(authenticationRequest.responseEndpoint, {
|
||||
id: challenge.id,
|
||||
signature: signature
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.error("Challenge not signed by registered service.");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user