0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #2049 from javorszky/iss-1841

Guard against multiple signup events
This commit is contained in:
Hannah Wolfe 2014-01-27 13:33:55 -08:00
commit 63ac0aa665

View file

@ -64,6 +64,7 @@
Ghost.Views.Signup = Ghost.View.extend({
initialize: function () {
this.submitted = "no";
this.render();
},
@ -95,10 +96,12 @@
Ghost.Validate.check(name, "Please enter a name").len(1);
Ghost.Validate.check(email, "Please enter a correct email address").isEmail();
Ghost.Validate.check(password, "Your password is not long enough. It must be at least 8 characters long.").len(8);
Ghost.Validate.check(this.submitted, "Ghost is signing you up. Please wait...").equals("no");
if (Ghost.Validate._errors.length > 0) {
Ghost.Validate.handleErrors();
} else {
this.submitted = "yes";
$.ajax({
url: Ghost.paths.subdir + '/ghost/signup/',
type: 'POST',
@ -114,6 +117,7 @@
window.location.href = msg.redirect;
},
error: function (xhr) {
this.submitted = "no";
Ghost.notifications.clearEverything();
Ghost.notifications.addItem({
type: 'error',