Prompt to agree to terms of service, add client-side user/pass check

master
Skylar Ittner 5 years ago
parent fe4629fcdb
commit 3cad059dbe

@ -61,8 +61,28 @@ function createAccount() {
var username = $("#username").val();
var password = $("#password").val();
app.preloader.show();
if (username.length < 1) {
app.dialog.alert("Enter a username.", "Error");
return;
}
if (password.length < SETTINGS["min_password_length"]) {
app.dialog.alert("Password must be at least " + SETTINGS["min_password_length"] + " characters long.", "Error");
return;
}
app.dialog.create({
text: "I agree to the terms of service and privacy policy.",
buttons: [
{
text: "No",
onClick: function () {
restartApplication();
}
},
{
text: "Yes",
onClick: function () {
app.preloader.show();
callAPI("signup", {
username: username,
password: password,
@ -75,3 +95,13 @@ function createAccount() {
app.dialog.alert(msg, "Error");
});
}
},
{
text: "Show",
onClick: function () {
openBrowser(SETTINGS["terms_of_service_url"]);
}
},
]
}).open();
}

@ -107,7 +107,7 @@ var routes = [
setting: "privacy",
title: "Privacy Policy",
text: "",
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=HelpingHelenaApp')"
onclick: "openBrowser('" + SETTINGS["terms_of_service_url"] + "')"
}]
}
});

@ -9,5 +9,7 @@
*/
var SETTINGS = {
server: "http://localhost/helpinghelena/api",
webapp_url: "https://app.helpinghelena.org/"
webapp_url: "https://app.helpinghelena.org/",
terms_of_service_url: "https://netsyms.com/legal?pk_campaign=HelpingHelenaApp",
min_password_length: 8
};
Loading…
Cancel
Save