reg still not working but almost

This commit is contained in:
quoije
2023-05-07 22:06:36 -04:00
parent 5b1f547820
commit fcbc1a0ab4
2 changed files with 25 additions and 7 deletions
+24 -6
View File
@@ -271,17 +271,35 @@ jQuery(function($) {
let reg_pass = document.getElementById("reg_pass");
let conf_pass = document.getElementById("conf_pass");
let reg_email = document.getElementById("reg_email");
let checkpass = checkPass(reg_pass,conf_pass);
body ='{"username": "'+ user +'","password": "'+ pass +'","email": "'+ email +'"}';
reg_body ='{"username": "'+ user +'","password": "'+ pass +'","email": "'+ email +'"}';
reg_body ='{"username": "'+ reg_user +'","password": "'+ checkpass +'","email": "'+ reg_email +'"}';
function checkPass(s1,s2){
if (s1==s2){
return s1
}
else {
return "error: pass don't match"
}
}
if (value) {
let req = require('request');
req.post({ headers: {'content-type' : 'application/json'}, url: "", body: body }, function(error, response, body){console.log(body); });
req.post({ headers: {'content-type' : 'application/json'}, url: "", body: body }, function(error, response, body){console.log(body);console.log(response);console.log(error); });
}
else {
let req = require('request');
req.post({ headers: {'content-type' : 'application/json'}, url: "", body: reg_body }, function(error, response, body){console.log(body); });
}
var url = "/api/auth/signup";
var params = reg_body;
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(params);
console.log(xhr.responseText)
}
}
// player things
@@ -345,7 +363,7 @@ jQuery(function($) {
console.log("registerTab");
tab1bj.setAttribute("aria-selected", "false");
tab2bj.setAttribute("aria-selected", "true");
mainbj.innerHTML = "<div id='logininput' class='typebox field-row-stacked'><input id='reg_user' type='text' placeholder='nom d" + "&#39;" + "utilisateur'/><input id='reg_pass' type='password' placeholder='mot de passe'/><input id='reg_conf_pass' type='password' placeholder='confirmer mot de passe'/><input id='reg_email' type='text' placeholder='email'/></div><div id='bjbuttons'><button disabled>s'enregistrer</button></div>"
mainbj.innerHTML = "<div id='logininput' class='typebox field-row-stacked'><input id='reg_user' type='text' placeholder='nom d" + "&#39;" + "utilisateur'/><input id='reg_pass' type='password' placeholder='mot de passe'/><input id='reg_conf_pass' type='password' placeholder='confirmer mot de passe'/><input id='reg_email' type='text' placeholder='email'/></div><div id='bjbuttons'><button onclick='checkLogin()'>s'enregistrer</button></div>"
}
// other scripts
+1 -1
View File
@@ -112,7 +112,7 @@
<pre>Microsoft&#10094;R&#10095; Windows DOS
&#10094;C&#10095; Copyright Microsoft Corp 1990-2001.
<br>C:&#92;WINDOWS&#92;RIPBOZO> type oof.txt
T'ES PAS CONNECTÉ :*(
<div id="authStat">T'ES PAS CONNECTÉ :*(</div>
</pre>
</div>