summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/auth/SignupView.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/lib/auth/SignupView.js')
-rw-r--r--StoneIsland/www/js/lib/auth/SignupView.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/StoneIsland/www/js/lib/auth/SignupView.js b/StoneIsland/www/js/lib/auth/SignupView.js
index 5d947d41..7f894c3c 100644
--- a/StoneIsland/www/js/lib/auth/SignupView.js
+++ b/StoneIsland/www/js/lib/auth/SignupView.js
@@ -12,7 +12,7 @@ var SignupView = FormView.extend({
"Gender": "U",
"Name": "TestName",
"Surname": "TestSurname",
- "Birthday": "1978-11-12",
+ "BirthDay": "1978-11-12",
"DataProfiling": true,
"DataProfiling2": true,
},
@@ -55,16 +55,17 @@ var SignupView = FormView.extend({
validate_fields: function(data, errors){
if (data.Password.length < 7) { errors.push([ "Password", "Password must be 7 characters or more." ]) }
if (data.Password !== data.Password2) { errors.push([ "Password2", "Passwords don't match." ]) }
+ 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.DataProfiling2 !== "true") { errors.push([ "DataProfiling2", "You must consent to use this service." ]) }
- if (! data.YooxLetter) { data.YooxLetter = "false" }
+ if (! data.YooxLetter) { data.YooxLetter = false }
delete data.DataProfiling2
delete data.ConfirmEmail
- data.Birthday += "T00:00:00Z"
+ data.BirthDay += "T00:00:00Z"
this.last_data = data
console.log(data)
@@ -84,9 +85,10 @@ var SignupView = FormView.extend({
success: function(data){
console.log('success', data)
auth.user = auth.user || {}
- auth.user.name = this.last_data.Name
- auth.user.surname = this.last_data.Surname
- auth.user.email = this.last_data.Email
+ auth.user.Name = this.last_data.Name
+ auth.user.Surname = this.last_data.Surname
+ auth.user.Email = this.last_data.Email
+ auth.user.BirthDay = this.last_data.BirthDay
app.account.logged_in(function(){ app.router.go("store") })
},