From ae8cb028715e46c46f58e1c2da3b7a4c32153c64 Mon Sep 17 00:00:00 2001 From: Maxence Lanone Date: Mon, 17 Oct 2022 10:33:40 +0200 Subject: [PATCH] remise app connexion --- src/App.js | 4 +- src/pages/Connexion.js | 112 ++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/App.js b/src/App.js index 8170580..286ca1a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,7 +1,7 @@ import React from 'react'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; -// import Connexion from './pages/Connexion'; -import Admin from './pages/Admin.js'; +import Connexion from './pages/Connexion'; +// import Admin from './pages/Admin.js'; const App = () => { return ( diff --git a/src/pages/Connexion.js b/src/pages/Connexion.js index fa55805..683f26d 100644 --- a/src/pages/Connexion.js +++ b/src/pages/Connexion.js @@ -1,63 +1,63 @@ -// import React from 'react'; -// import CryptoJS from 'crypto-js'; +import React from 'react'; +import CryptoJS from 'crypto-js'; -// const Connexion = () => { -// return ( -//
-// {/* Create a connexion page */} -// -//
-// -// -// Connexion -// -// -// -// -// -// -// -// -//
-// -// -//
-// -// -//
-//
+const Connexion = () => { + return ( +
+ {/* Create a connexion page */} + +
+ + + Connexion + + + + + + + + +
+ + +
+ + +
+
-// Mot de passe oubliƩ ? -//
-// ); -// }; + Mot de passe oubliƩ ? +
+ ); +}; -// /* Envoyer le pseudo et le mot de passe */ -// function sendPseudo() { -// var pseudo = document.getElementById("pseudo").value; -// var password = document.getElementById("password").value; -// // transforme le pseudo en son format sha256 -// console.log(password); -// var password = CryptoJS.SHA256(password).toString(CryptoJS.enc.Hex); -// console.log(password); -// var data = { -// pseudo: pseudo, -// password: password -// }; -// console.log(data); -// // var xhr = new XMLHttpRequest(); -// // xhr.open("POST", "http://localhost:3000/api/auth/login", true); -// // xhr.setRequestHeader('Content-Type', 'application/json'); -// // xhr.send(JSON.stringify(data)); -// // xhr.onreadystatechange = function () { -// // if (xhr.readyState === 4 && xhr.status === 200) { -// // var json = JSON.parse(xhr.responseText); -// // console.log(json); -// // } -// // } -// } +/* Envoyer le pseudo et le mot de passe */ +function sendPseudo() { + var pseudo = document.getElementById("pseudo").value; + var password = document.getElementById("password").value; + // transforme le pseudo en son format sha256 + console.log(password); + var password = CryptoJS.SHA256(password).toString(CryptoJS.enc.Hex); + console.log(password); + var data = { + pseudo: pseudo, + password: password + }; + console.log(data); + // var xhr = new XMLHttpRequest(); + // xhr.open("POST", "http://localhost:3000/api/auth/login", true); + // xhr.setRequestHeader('Content-Type', 'application/json'); + // xhr.send(JSON.stringify(data)); + // xhr.onreadystatechange = function () { + // if (xhr.readyState === 4 && xhr.status === 200) { + // var json = JSON.parse(xhr.responseText); + // console.log(json); + // } + // } +} -// export default Connexion; \ No newline at end of file +export default Connexion; \ No newline at end of file