Merge pull request 'changement du fonctionnement de l'envoie d'email de confirmation lors du changement de mot de passe afin que l'on ne puisse plus spam l'envoie de mail et ainsi éviter les bugs' (#107) from bug_multi_mail into master
continuous-integration/drone/push Build is passing Details

Reviewed-on: hugo.livet/ConsEco#107
UI_Mobile
Lucas EVARD 2 years ago
commit 14e039f81d

@ -1,3 +1,4 @@
using Android.Renderscripts;
using Model; using Model;
using Email = Model.Email; using Email = Model.Email;
@ -7,6 +8,9 @@ public partial class ForgetPassword : ContentPage
{ {
public Manager Mgr => (App.Current as App).Manager; public Manager Mgr => (App.Current as App).Manager;
private string code; private string code;
private DateTime _startTime;
private CancellationTokenSource _cancellationTokenSource;
public ForgetPassword() public ForgetPassword()
{ {
InitializeComponent(); InitializeComponent();
@ -22,14 +26,30 @@ public partial class ForgetPassword : ContentPage
code = generator.Next(0, 1000000).ToString("D6"); code = generator.Next(0, 1000000).ToString("D6");
Email.CreateMail(EntryMail.Text, code); Email.CreateMail(EntryMail.Text, code);
ValidateReceptCode.IsVisible = true; ValidateReceptCode.IsVisible = true;
ConnexionButton.IsEnabled = false;
UpdateArc();
} }
} }
private async void AffichError(string s, string s1, string s2) private async void AffichError(string s, string s1, string s2)
{ {
await DisplayAlert(s, s1, 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) if(EntryCodeRecept.Text == code)
{ {

Loading…
Cancel
Save