From 6a5c54f2bc2f566ca2dfa78e2e6189f822eee15b Mon Sep 17 00:00:00 2001 From: Tristan Barlet Date: Wed, 19 Oct 2022 14:14:15 +0200 Subject: [PATCH 1/5] Mise en place du sha256 --- server-api/package-lock.json | 1 + server-api/package.json | 1 + src/pages/Connexion.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) 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) { From d1471400007d1488ea3f230a2e683a1cae204334 Mon Sep 17 00:00:00 2001 From: Theo DUPIN Date: Wed, 19 Oct 2022 14:14:17 +0200 Subject: [PATCH 2/5] Changement Page Admin --- src/App.js | 6 +- src/pages/Admin.js | 9 ++- src/styles/components/_admin.scss | 96 +++++++++++++++++------------- src/styles/components/_compte.scss | 4 +- 4 files changed, 65 insertions(+), 50 deletions(-) diff --git a/src/App.js b/src/App.js index 8709486..6afa748 100644 --- a/src/App.js +++ b/src/App.js @@ -1,8 +1,8 @@ import React from 'react'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; -import Compte from './pages/Compte'; +//import Compte from './pages/Compte'; //import Connexion from './pages/Connexion'; -// import Admin from './pages/Admin.js'; +import Admin from './pages/Admin.js'; const App = () => { return ( @@ -12,7 +12,7 @@ const App = () => { // // - + ); } diff --git a/src/pages/Admin.js b/src/pages/Admin.js index ddfdb78..df213a4 100644 --- a/src/pages/Admin.js +++ b/src/pages/Admin.js @@ -17,7 +17,7 @@ const Admin = () => { -

Admin

+

Admin

@@ -42,12 +42,15 @@ const Admin = () => { - - +
+ + +
+

); }; diff --git a/src/styles/components/_admin.scss b/src/styles/components/_admin.scss index e4abb1b..2edd0dc 100644 --- a/src/styles/components/_admin.scss +++ b/src/styles/components/_admin.scss @@ -100,67 +100,79 @@ }*/ - .Formulaire{ - display: flex; - flex-direction: column; - align-items: center; - width: 100%; - } + .formulaire{ display: flex; flex-direction: column; + border-radius: 30px; margin: 100px; padding: 30px; align-items: center; } - .Titre{ display: flex; - flex-direction: row; + flex-direction: column; + flex-basis: 100%; + border: 5px white inset; font-weight: bold; font-size: 80px; - margin: 20px; - } - .texte{ - align-self: center; - font-weight: bold; - padding: 10px; - } + .Formulaire{ + display: flex; + flex-direction: column; + border: 5px white inset; + align-items: center; + font-size: 30px; + width: 100%; + } - .texte_zone{ - width: 600px; - height: 50px; - font-size: 30px; - } + .texte{ + display: flex; + flex-direction: row; + align-self: center; + font-weight: bold; + padding: 10px; + } - .bouton_val_ann{ - width: 150px; - height: 40px; - border-radius: 10px; - border: 0.5px solid; - color: $white; - border: 0; - background-color: black; - border: 1px solid rgba(255,255,255,0.1); - backdrop-filter: blur(30px); - color: rgb(255, 255, 255); - cursor: pointer; - font-size: 15px; - &:hover{ - background-color: rgba(114, 114, 114, 0.371); + .texte_zone{ + width: 600px; + height: 50px; + font-size: 30px; } - &:active{ - background-color:rgba(68, 68, 68, 0.972); + + .bouton_val_ann{ + width: 150px; + height: 40px; + border-radius: 10px; + border: 0.5px solid; + color: $white; + border: 0; + background-color: black; + border: 1px solid rgba(255,255,255,0.1); + backdrop-filter: blur(30px); + color: rgb(255, 255, 255); + cursor: pointer; + font-size: 15px; + &:hover{ + background-color: rgba(114, 114, 114, 0.371); + } + &:active{ + background-color:rgba(68, 68, 68, 0.972); + } + } + + .texte_barre{ + display: flex; + width: 400px; } - } - .texte_barre{ - display: flex; - width: 400px; - } + .bouton_submit{ + display: flex; + flex-direction: row; + } + } } diff --git a/src/styles/components/_compte.scss b/src/styles/components/_compte.scss index 1f312ed..d9c3cc6 100644 --- a/src/styles/components/_compte.scss +++ b/src/styles/components/_compte.scss @@ -91,7 +91,7 @@ body { flex-direction: row; justify-content: space-between; width: auto; - height: 86%; + height: 82%; .nav_bar_verticale { display: flex; @@ -109,7 +109,7 @@ body { .Compte { display: flex; flex-direction: column; - width: 94.3%; + width: 94%; height: auto; background: rgba(255, 255, 255, 0.3); From ea86f258a39c52d4d6aeb5112ae998d38a9d87e1 Mon Sep 17 00:00:00 2001 From: Jeremy DUCOURTHIAL Date: Wed, 19 Oct 2022 14:41:55 +0200 Subject: [PATCH 3/5] =?UTF-8?q?S=C3=A9curisation=20du=20mot=20de=20passe?= =?UTF-8?q?=20sur=20la=20page=20connexion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Connexion.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/Connexion.js b/src/pages/Connexion.js index 6face55..3154f95 100644 --- a/src/pages/Connexion.js +++ b/src/pages/Connexion.js @@ -17,7 +17,7 @@ function Connexion() { } function changePassword(event) { - setPassword(CryptoJS.SHA256(event.target.value).toString(CryptoJS.enc.Hex)); + setPassword(event.target.value); } function chechAuth(event) { @@ -34,9 +34,12 @@ function Connexion() { setAuth("Failed"); return; } - const apiString = '/User/Auth/' + login + "/" + password; + + const apiString = '/User/Auth/' + login + "/" + CryptoJS.SHA256(password).toString(CryptoJS.enc.Hex); api.get(apiString).then((response) => { const users = response.data; + console.log(response.data.length); + console.log(users.length); if (users.length > 0) if (users[0].result === 1) setAuth("Succeed"); @@ -73,9 +76,9 @@ function Connexion() { -

{auth === ""?'':auth === "Failed"?'Authentification Failed':'User Unknown'}

+ Mot de passe oublié ? +

{auth === ""?'':auth === "Failed"?'Authentification Echoué':'Utilisateur inconnu'}

- Mot de passe oublié ? ); } From e495fd636a29bd5994af5c41d9a0a2b33c0c2497 Mon Sep 17 00:00:00 2001 From: Theo DUPIN Date: Wed, 19 Oct 2022 14:48:47 +0200 Subject: [PATCH 4/5] Changement Page Admin --- src/pages/Admin.js | 6 +-- src/styles/components/_admin.scss | 66 ++++++++++++++----------------- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/src/pages/Admin.js b/src/pages/Admin.js index 8bb62c7..fc4aecf 100644 --- a/src/pages/Admin.js +++ b/src/pages/Admin.js @@ -8,13 +8,13 @@ const Admin = () => {
- +
- +
- +

Admin diff --git a/src/styles/components/_admin.scss b/src/styles/components/_admin.scss index 056ff8a..c357bf5 100644 --- a/src/styles/components/_admin.scss +++ b/src/styles/components/_admin.scss @@ -1,26 +1,36 @@ .page_admin { display: flex; flex-direction: row; + flex-basis: 100%; + height: 100vh; + position:fixed; .nav_bar_verticale { display: flex; flex-direction: column; width: 200px; - height: 753px; - border: 5px white inset; + height: 735px; + background: rgba(255, 255, 255, 0.143); + box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37); + backdrop-filter: blur(3px); + -webkit-backdrop-filter: blur(1.5px); + border-radius: 15px; + border: 1px solid rgba(255, 255, 255, 0.18); + margin: 10px; + .create_user { - padding: 30px; + padding: 5px; align-self: center; } .modify_user { - padding: 30px; + padding: 5px; align-self: center; } .delete_user { - padding: 30px; + padding: 5px; align-self: center; } @@ -32,39 +42,29 @@ position: relative; width: 180px; height: 100px; - border-radius: 30px; + border-radius: 10px; font-size: 13.5px; font-weight: bold; transition: 1s box-shadow; cursor: pointer; border: none; box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); - background-color: white; - } - - - .bouton:hover { - box-shadow: 0, 5px, 35px, 0 rgba(0, 0, 0, 1); - color: white; - background-color: black; - } + background-color: rgba(163, 163, 163, 0.371); + border: 1px solid rgba(255,255,255,0.1); + backdrop-filter: blur(30px); + color: rgb(255, 255, 255); + cursor: pointer; + font-size: 17px; - .bouton:hover::before, - .bouton:hover::after { - content: ''; - display: block; - position: absolute; - z-index: -1; - width: 100%; - height: 100%; - background: black; - border-radius: 30px; - animation: 0.5s jiggle infinite; - } + &:hover{ + box-shadow: 0, 5px, 35px, 0 rgba(0, 0, 0, 1); + color: white; + background-color: rgba(114, 114, 114, 0.371); + } - .bouton:hover::after { - background: black; - animation: 1s jiggle infinite; + &:active{ + background-color:rgba(68, 68, 68, 0.972); + } } } @@ -90,12 +90,6 @@ align-items: center; } - .form{ - align-self: center; - flex-direction: row; - font-weight: bold; - font-size: 80px; - .texte { align-self: center; font-weight: bold; From 9dd45f29b5bd407d2675f30416ae2e7e2567052b Mon Sep 17 00:00:00 2001 From: Tristan BARLET Date: Wed, 19 Oct 2022 17:48:20 +0200 Subject: [PATCH 5/5] mise en place DRONE --- .drone.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..e9d2fa5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,13 @@ +kind: pipeline +name: JTT_CRM_Pipeline + +trigger: + event: + - push + +steps: +- name: start + image: node + commands: + - npm install + - npm start