save contact

This commit is contained in:
AJ ONeal 2018-05-04 23:59:05 +00:00
parent 426e28d1b2
commit 60b082788f
2 changed files with 28 additions and 0 deletions

View File

@ -58,6 +58,29 @@
$el.addEventListener('change', updateChallengeType); $el.addEventListener('change', updateChallengeType);
}); });
function saveContact(email, domains) {
// to be used for good, not evil
return window.fetch('https://api.ppl.family/api/ppl.family/public/list', {
method: 'POST'
, cors: true
, headers: new Headers({ 'Content-Type': 'application/json' })
, body: JSON.stringify({ address: email, comment: 'greenlock sub for ' + domains.join(',') })
}).then(function (resp) {
return resp.json().then(function (data) {
/*
if (data.error) {
window.alert("Couldn't save your contact. Email coolaj86@gmail.com instead.");
return;
}
*/
});
}, function () {
/*
window.alert("Didn't get your contact. Bad network connection? Email coolaj86@gmail.com instead.");
*/
});
}
steps[1] = function () { steps[1] = function () {
hideForms(); hideForms();
$qs('.js-acme-form-domains').hidden = false; $qs('.js-acme-form-domains').hidden = false;
@ -90,6 +113,7 @@
steps[2].submit = function () { steps[2].submit = function () {
var email = $qs('.js-acme-account-email').value.toLowerCase().trim(); var email = $qs('.js-acme-account-email').value.toLowerCase().trim();
info.contact = [ 'mailto:' + email ]; info.contact = [ 'mailto:' + email ];
info.agree = $qs('.js-acme-account-tos').checked; info.agree = $qs('.js-acme-account-tos').checked;
info.greenlockAgree = $qs('.js-gl-tos').checked; info.greenlockAgree = $qs('.js-gl-tos').checked;
@ -99,6 +123,7 @@
// * ECDSA / RSA / bitlength // * ECDSA / RSA / bitlength
// TODO ping with version and account creation // TODO ping with version and account creation
setTimeout(saveContact, 100, email, info.identifiers.map(function (ident) { return ident.value; }));
var jwk = JSON.parse(localStorage.getItem('account:' + email) || 'null'); var jwk = JSON.parse(localStorage.getItem('account:' + email) || 'null');
var p; var p;

3
legal.html Normal file
View File

@ -0,0 +1,3 @@
You will use the Greenlock&trade; service, code, libraries, documentation, etc (provided by <a href="https://ppl.family">ppl</a>) for good, not evil (i.e. securing sites, not terrorizing underprivileged peoples or overpriviledged nations).
We will use your contact You will use the Greenlock&trade; service, code, libraries, documentation, etc for good, not evil (i.e. notifying as we improve the service or need to disclose important information, not spam or selling your data to the devil and his minions for filthy lucre).