From cf0ee1c064305471653a5b3ce4ae480bf2dc5a2a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 28 Oct 2019 02:26:27 -0600 Subject: [PATCH] logging fixes --- account.js | 13 +++++++++++-- maintainers.js | 7 +++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/account.js b/account.js index e49b9f2..f1d0b7c 100644 --- a/account.js +++ b/account.js @@ -5,6 +5,7 @@ var U = require('./utils.js'); var Keypairs = require('@root/keypairs'); var Enc = require('@root/encoding/bytes'); +var agreers = {}; A._getAccountKid = function(me, options) { // It's just fine if there's no account, we'll go get the key id we need via the existing key @@ -138,8 +139,15 @@ A._registerAccount = function(me, options) { var agreeToTerms = options.agreeToTerms; if (!agreeToTerms) { agreeToTerms = function(terms) { - console.log( - 'By using this software you accept this Subscriber Agreement and Terms of Service:' + if (agreers[options.subscriberEmail]) { + return true; + } + agreers[options.subscriberEmail] = true; + console.info(); + console.info( + 'By using this software you (' + + options.subscriberEmail + + ') are agreeing to the following:' ); console.info( 'ACME Subscriber Agreement:', @@ -149,6 +157,7 @@ A._registerAccount = function(me, options) { 'Greenlock/ACME.js Terms of Use:', terms.acmeJsTermsUrl ); + console.info(); return true; }; } else if (true === agreeToTerms) { diff --git a/maintainers.js b/maintainers.js index ac5f4e2..437eb10 100644 --- a/maintainers.js +++ b/maintainers.js @@ -55,7 +55,7 @@ M._init = function(me, tz, locale) { 'https://api.rootprojects.org/api/projects/ACME.js/dependents', json: { maintainer: me.maintainerEmail, - package: me.packageAgent, + package: me.packageAgent, tz: tz, locale: locale } @@ -63,7 +63,10 @@ M._init = function(me, tz, locale) { return me .request(req) .catch(function(err) { - if (true || me.debug) { + if (me.debug) { + console.error( + 'error adding maintainer to support notices:' + ); console.error(err); } })