reg still not working but almost
This commit is contained in:
@@ -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" + "'" + "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" + "'" + "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
@@ -112,7 +112,7 @@
|
||||
<pre>Microsoft❮R❯ Windows DOS
|
||||
❮C❯ Copyright Microsoft Corp 1990-2001.
|
||||
<br>C:\WINDOWS\RIPBOZO> type oof.txt
|
||||
T'ES PAS CONNECTÉ :*(
|
||||
<div id="authStat">T'ES PAS CONNECTÉ :*(</div>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user