From ceff9e0ed76f0fbd7dfab10169d0593c275d1f70 Mon Sep 17 00:00:00 2001 From: Vincent ASTOLFI Date: Fri, 6 Jan 2023 14:24:05 +0100 Subject: [PATCH] =?UTF-8?q?r=C3=A9paration=20de=20la=20connexion=20et=20pr?= =?UTF-8?q?otection=20des=20mots=20de=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Data/PersAPI.cs | 1 - Sources/Data/tables.sql | 2 +- Sources/IHM/Mobile/Inscription.xaml.cs | 3 ++- Sources/IHM/Mobile/MainPage.xaml.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Data/PersAPI.cs b/Sources/Data/PersAPI.cs index 93e1bda..ac358ef 100644 --- a/Sources/Data/PersAPI.cs +++ b/Sources/Data/PersAPI.cs @@ -34,7 +34,6 @@ namespace Data return inscrits.First(); } throw new ArgumentException("Cet email a un problème"); - } public async Task EmailDisponible(string mail) { diff --git a/Sources/Data/tables.sql b/Sources/Data/tables.sql index 215b992..7ea8a68 100644 --- a/Sources/Data/tables.sql +++ b/Sources/Data/tables.sql @@ -21,7 +21,7 @@ CREATE TABLE Inscrit nom varchar(40), prenom varchar(40), mail varchar(40) UNIQUE, - mdp varchar(40) + mdp varchar(200) ); CREATE TABLE DeviseInscrit diff --git a/Sources/IHM/Mobile/Inscription.xaml.cs b/Sources/IHM/Mobile/Inscription.xaml.cs index 7f40322..576bda0 100644 --- a/Sources/IHM/Mobile/Inscription.xaml.cs +++ b/Sources/IHM/Mobile/Inscription.xaml.cs @@ -50,7 +50,8 @@ public partial class Inscription : ContentPage { if (EntryCodeRecept.Text == code) { - Inscrit inscrit = new Inscrit(1, EntryNewName.Text, EntryNewMail.Text, EntryNewSurname.Text, EntryNewPassword.Text); + string hashedPassword = Hash.CreateHashCode(EntryNewPassword.Text); + Inscrit inscrit = new Inscrit(1, EntryNewName.Text, EntryNewMail.Text, EntryNewSurname.Text, hashedPassword); Mgr.Pers.AjouterInscrit(inscrit); AffichError("compte créé", "Compte bien créé", "OK"); NavigateTo(".."); diff --git a/Sources/IHM/Mobile/MainPage.xaml.cs b/Sources/IHM/Mobile/MainPage.xaml.cs index ce6e963..c604746 100644 --- a/Sources/IHM/Mobile/MainPage.xaml.cs +++ b/Sources/IHM/Mobile/MainPage.xaml.cs @@ -42,7 +42,7 @@ namespace IHM.Mobile private async void ConnexionValide() { - Mgr.LoadBanques(); + //Mgr.LoadBanques(); await Navigation.PopModalAsync(); }