You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BIG commit. The web is now almost ready for realease. v0.9.7 No known bugs for now. (/profile/edit can edit everything with many possible cases and a flash for every case + backend validation in every section)
/* In case the user doesn't introduce nothing in the fullname field (or the data introduced is not valid) it will let him and the program know the fullname hasn't been updated. */
129
+
fullnameOK=false;
130
+
console.log(`The fullname doesn't contain anything or the data inside the input has invalid characters.`);
131
+
}
132
+
/* If the user introduced both passwords and both match the REGEX: */
/* In case the user doesn't introduce nothing in the passwords fields (or the data introduced is not valid) it will let him and the program know the password hasn't been updated. */
156
+
passwordOK=false;
157
+
console.log(`The password doesn't contain anything or the data inside the input has invalid characters.`);
158
+
}
159
+
}
160
+
if(fullnameOK&&passwordOK){
161
+
returndone(null,req.user,req.flash('bothUpdated','Both fullname and password has been updated.'));
162
+
}elseif(fullnameOK){
163
+
returndone(null,req.user,req.flash('onlyFullnameUpdated','Only your fullname has been updated.'));
164
+
}elseif(passwordOK){
165
+
returndone(null,req.user,req.flash('onlyPasswordUpdated','Only your password has been updated.'));
166
+
}else{
167
+
returndone(null,false,req.flash('nothingUpdated','We could not update anything in the DB. Check both inputs.'));
168
+
}
169
+
}else{
170
+
returndone(null,false,req.flash('moreThanOneUser','There are more than 2 users with that ID. That is not supposed to happen. Please contact any administrator so he can delete one of the accounts.'));
171
+
}
172
+
},
173
+
),
174
+
);
175
+
80
176
/* Serializing the user to maintain the session. */
0 commit comments