diff options
Diffstat (limited to 'StoneIsland/www/js/lib/auth')
| -rwxr-xr-x | StoneIsland/www/js/lib/auth/LoginView.js | 4 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/auth/LogoutView.js | 1 | ||||
| -rwxr-xr-x | StoneIsland/www/js/lib/auth/SignupView.js | 10 |
3 files changed, 8 insertions, 7 deletions
diff --git a/StoneIsland/www/js/lib/auth/LoginView.js b/StoneIsland/www/js/lib/auth/LoginView.js index aeb15d1d..c3d839a5 100755 --- a/StoneIsland/www/js/lib/auth/LoginView.js +++ b/StoneIsland/www/js/lib/auth/LoginView.js @@ -43,9 +43,7 @@ var LoginView = FormView.extend({ success: function(data){ console.log(data) - app.account.logged_in(function(){ - app.router.go("store") - }) + app.account.logged_in(null, "store") }, error: function(data){ diff --git a/StoneIsland/www/js/lib/auth/LogoutView.js b/StoneIsland/www/js/lib/auth/LogoutView.js index 89091473..d3f76428 100755 --- a/StoneIsland/www/js/lib/auth/LogoutView.js +++ b/StoneIsland/www/js/lib/auth/LogoutView.js @@ -10,6 +10,7 @@ var LogoutView = View.extend({ app.header.set_cart_count(0) app.footer.hide() auth.log_out() + localStorage.setItem('account_terms.consent', 'false') app.demand_consent = false app.account.consent.hide() app.account.logged_out() 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){ |
