diff --git a/server-api/package-lock.json b/server-api/package-lock.json index a3cdf71..5274493 100644 --- a/server-api/package-lock.json +++ b/server-api/package-lock.json @@ -10,6 +10,7 @@ "license": "ISC", "dependencies": { "axios": "^1.1.3", + "body-parser": "^1.20.1", "cors": "^2.8.5", "express": "^4.18.2", "mysql": "^2.18.1" diff --git a/server-api/package.json b/server-api/package.json index 4abc910..7100fbe 100644 --- a/server-api/package.json +++ b/server-api/package.json @@ -11,6 +11,7 @@ "license": "ISC", "dependencies": { "axios": "^1.1.3", + "body-parser": "^1.20.1", "cors": "^2.8.5", "express": "^4.18.2", "mysql": "^2.18.1" diff --git a/src/pages/Connexion.js b/src/pages/Connexion.js index 12bb309..0c97da8 100644 --- a/src/pages/Connexion.js +++ b/src/pages/Connexion.js @@ -1,5 +1,6 @@ import axios from 'axios' import React, { useState } from 'react'; +import CryptoJS from 'crypto-js'; const api = axios.create({ baseURL: 'http://localhost:8080' @@ -16,7 +17,7 @@ function Connexion() { } function changePassword(event) { - setPassword(event.target.value); + setPassword(CryptoJS.SHA256(event.target.value).toString(CryptoJS.enc.Hex)); } function chechAuth(event) {