From 3d4b413029234b2078136f57633eb8dc48e4059b Mon Sep 17 00:00:00 2001 From: Vincent ASTOLFI Date: Mon, 14 Nov 2022 16:36:13 +0100 Subject: [PATCH] =?UTF-8?q?changement=20du=20fonctionnement=20de=20l'envoi?= =?UTF-8?q?e=20d'email=20de=20confirmation=20lors=20du=20changement=20de?= =?UTF-8?q?=20mot=20de=20passe=20afin=20que=20l'on=20ne=20puisse=20plus=20?= =?UTF-8?q?spam=20l'envoie=20de=20mail=20et=20ainsi=20=C3=A9viter=20les=20?= =?UTF-8?q?bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/IHM/ForgetPassword.xaml.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Sources/IHM/ForgetPassword.xaml.cs b/Sources/IHM/ForgetPassword.xaml.cs index b4eac3f..37e1e20 100644 --- a/Sources/IHM/ForgetPassword.xaml.cs +++ b/Sources/IHM/ForgetPassword.xaml.cs @@ -1,3 +1,4 @@ +using Android.Renderscripts; using Model; using Email = Model.Email; @@ -7,6 +8,9 @@ public partial class ForgetPassword : ContentPage { public Manager Mgr => (App.Current as App).Manager; private string code; + private DateTime _startTime; + private CancellationTokenSource _cancellationTokenSource; + public ForgetPassword() { InitializeComponent(); @@ -22,14 +26,30 @@ public partial class ForgetPassword : ContentPage code = generator.Next(0, 1000000).ToString("D6"); Email.CreateMail(EntryMail.Text, code); ValidateReceptCode.IsVisible = true; + ConnexionButton.IsEnabled = false; + UpdateArc(); } } private async void AffichError(string s, string s1, string s2) { await DisplayAlert(s, s1, s2); } + private async void UpdateArc() + { + int timeRemaining = 60; + while (timeRemaining != 0) + { + ConnexionButton.Text = $"{timeRemaining}"; + + timeRemaining--; - private void ValideCode(object sender, EventArgs e) + await Task.Delay(1000); + } + + ConnexionButton.Text = "valider Email"; + ConnexionButton.IsEnabled = true; + } + private void ValideCode(object sender, EventArgs e) { if(EntryCodeRecept.Text == code) {