Merge branch 'master' of https://git.xdrm.io/ndli1718/main
This commit is contained in:
commit
26c6a6bb22
|
@ -44,21 +44,30 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
create_account() {
|
create_account() {
|
||||||
|
const const_username = this.username_val;
|
||||||
|
const const_mail = this.mail_val;
|
||||||
|
const const_password = this.password_val;
|
||||||
|
|
||||||
let request = {
|
let request = {
|
||||||
username: this.username_val,
|
username: const_username,
|
||||||
mail: this.mail_val,
|
mail: const_mail,
|
||||||
password: this.password_val
|
password: const_password
|
||||||
};
|
};
|
||||||
|
|
||||||
api.call("POST user/signup", request, function (response) {
|
api.call("POST user/signup", request, function (response) {
|
||||||
/* (1) Check if is there an error and display theme that goes with */
|
/* (1) Check if is there an error and display theme that goes with */
|
||||||
console.log(response);
|
if (response.error == 17 && response.ErrorDescription.indexOf('mail') !== -1) {
|
||||||
if (response.error == 17) {
|
|
||||||
this.err_username = false;
|
this.err_username = false;
|
||||||
this.err_mail = true;
|
this.err_mail = true;
|
||||||
this.err_unknow = false;
|
this.err_unknow = false;
|
||||||
this.err_message = 'Le mail est invalide';
|
this.err_message = 'Le mail est invalide';
|
||||||
}
|
}
|
||||||
|
else if (response.error == 17 && response.ErrorDescription.indexOf('username') !== -1) {
|
||||||
|
this.err_username = true;
|
||||||
|
this.err_mail = false;
|
||||||
|
this.err_unknow = false;
|
||||||
|
this.err_message = 'Le nom d\'utilisateur a des caractères invalides';
|
||||||
|
}
|
||||||
else if (response.error == 29) {
|
else if (response.error == 29) {
|
||||||
this.err_username = true;
|
this.err_username = true;
|
||||||
this.err_mail = true;
|
this.err_mail = true;
|
||||||
|
@ -73,11 +82,11 @@
|
||||||
}
|
}
|
||||||
/* (2) Close the sign up form authentication */
|
/* (2) Close the sign up form authentication */
|
||||||
else {
|
else {
|
||||||
this.infobox._display('Inscription terminée ! Connexion en cours ...', 'info', 3000);
|
infobox._display('Inscription terminée ! Connexion en cours ...', 'info', 3000);
|
||||||
|
|
||||||
let request = {
|
let request = {
|
||||||
username: this.username_val,
|
username: const_username,
|
||||||
password: this.password_val
|
password: const_password
|
||||||
};
|
};
|
||||||
|
|
||||||
api.call("POST user/login", request, function (response) {
|
api.call("POST user/login", request, function (response) {
|
||||||
|
|
Loading…
Reference in New Issue