summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js')
-rwxr-xr-xStoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js20
1 files changed, 16 insertions, 4 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 ed702a03..078f7c07 100755
--- a/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/platforms/android/assets/www/js/lib/auth/SignupView.js
@@ -49,10 +49,11 @@ var SignupView = FormView.extend({
"Surname": "Please enter your last name.",
"Email": "Please enter a valid email address.",
"ConfirmEmail": "Please enter a valid email address.",
- // "BirthDay": "Please enter your birthday.",
+ "BirthDay": "Please enter your birthday. You must be 18 or older to use the Stone Island app.",
"Password": "Please enter your password.",
"Password2": "Please enter your password again.",
- "DataProfiling": "You must agree to data profiling.",
+ "DataProfiling": "You must consent to data profiling to use the Stone Island app.",
+ "AccountTerms": "You must agree to the Your My Account terms.",
},
validate_fields: function(data, errors){
@@ -62,8 +63,18 @@ var SignupView = FormView.extend({
if (! data.Email.match("@")) { errors.push([ "Email", "Email address is not valid." ]) }
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 use this service." ]) }
- if (! data.BirthDay) data.BirthDay = '1900-01-01'
+ 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." ]) }
+
+ var now = new Date ()
+ var year = now.getFullYear()
+ 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) {
+ errors.push(['BirthDay', 'You must be 18 or older to use the Stone Island app.'])
+ }
+
data.YooxLetter = this.$("[name=YooxLetter]").prop("checked")
},
@@ -96,6 +107,7 @@ var SignupView = FormView.extend({
auth.user.Surname = this.last_data.Surname
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") })
},