Mise en place du sha256

master
Tristan BARLET 3 years ago
parent 88890c6480
commit 6a5c54f2bc

@ -10,6 +10,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^1.1.3", "axios": "^1.1.3",
"body-parser": "^1.20.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.18.2", "express": "^4.18.2",
"mysql": "^2.18.1" "mysql": "^2.18.1"

@ -11,6 +11,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"axios": "^1.1.3", "axios": "^1.1.3",
"body-parser": "^1.20.1",
"cors": "^2.8.5", "cors": "^2.8.5",
"express": "^4.18.2", "express": "^4.18.2",
"mysql": "^2.18.1" "mysql": "^2.18.1"

@ -1,5 +1,6 @@
import axios from 'axios' import axios from 'axios'
import React, { useState } from 'react'; import React, { useState } from 'react';
import CryptoJS from 'crypto-js';
const api = axios.create({ const api = axios.create({
baseURL: 'http://localhost:8080' baseURL: 'http://localhost:8080'
@ -16,7 +17,7 @@ function Connexion() {
} }
function changePassword(event) { function changePassword(event) {
setPassword(event.target.value); setPassword(CryptoJS.SHA256(event.target.value).toString(CryptoJS.enc.Hex));
} }
function chechAuth(event) { function chechAuth(event) {

Loading…
Cancel
Save