save contact
This commit is contained in:
parent
fde9edd139
commit
3854e6b430
25
js/app.js
25
js/app.js
|
@ -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;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
You will use the Greenlock™ 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™ 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).
|
Loading…
Reference in New Issue