From 58eb0a78f6c0e717278a2ac2e00ef2afa2cbea2b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 3 Oct 2018 03:08:25 +0200 Subject: do everything we can to force lockout --- StoneIsland/www/js/lib/auth/SignupView.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'StoneIsland/www/js/lib/auth/SignupView.js') diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js index 078f7c07..917644d2 100755 --- a/StoneIsland/www/js/lib/auth/SignupView.js +++ b/StoneIsland/www/js/lib/auth/SignupView.js @@ -68,10 +68,12 @@ var SignupView = FormView.extend({ var now = new Date () var year = now.getFullYear() - if (! data.Birthday) data.BirthDay = year + '-01-01' - if (data.BirthDay.split('-')[0] || '2018') + if (! data.BirthDay) { + data.BirthDay = year + '-01-01' + } + // if (data.BirthDay.split('-')[0] || '2018') var birthday = new Date (data.BirthDay) - if (isNaN(birthday) || (now - birthday) / (365*24*60*60*1000) < 18) { + if (isNaN(birthday) || (new Date () - birthday) / (365*24*60*60*1000) < 18) { errors.push(['BirthDay', 'You must be 18 or older to use the Stone Island app.']) } @@ -108,7 +110,7 @@ var SignupView = FormView.extend({ auth.user.Email = this.last_data.Email auth.user.BirthDay = this.last_data.BirthDay localStorage.setItem('account_terms.consent', 'true') - app.account.logged_in(function(){ app.router.go("store") }) + app.account.logged_in(null, "store") }, error: function(data){ -- cgit v1.2.3-70-g09d2