summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-10-03 05:29:35 +0200
committerJules Laplace <julescarbon@gmail.com>2018-10-03 05:29:35 +0200
commit21b41e6c7cbde9d60e8e99dfce8331c218068052 (patch)
tree4cc513245f2e0b822c9083b2d2e30556894d3709 /StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
parent58eb0a78f6c0e717278a2ac2e00ef2afa2cbea2b (diff)
buildl
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
index 078f7c07..ef7dd6aa 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
@@ -53,7 +53,7 @@ var SignupView = FormView.extend({
"Password": "Please enter your password.",
"Password2": "Please enter your password again.",
"DataProfiling": "You must consent to data profiling to use the Stone Island app.",
- "AccountTerms": "You must agree to the Your My Account terms.",
+ "GdprTerms": "You must agree to the Your My Account terms.",
},
validate_fields: function(data, errors){
@@ -64,14 +64,16 @@ var SignupView = FormView.extend({
if (data.Email.toLowerCase() !== data.ConfirmEmail.toLowerCase()) { errors.push([ "ConfirmEmail", "Email addresses don't match." ]) }
// if (data.Gender === "NONE") { errors.push([ "Gender", "Please supply your gender." ]) }
if (data.DataProfiling !== "true") { errors.push([ "DataProfiling", "You must consent to data profiling to use the Stone Island app." ]) }
- if (data.AccountTerms !== "true") { errors.push([ "AccountTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) }
+ if (data.GdprTerms !== "true") { errors.push([ "GdprTerms", "You must agree to the Your My Account terms to use the Stone Island app." ]) }
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){