Esempio n. 1
0
        private void ForgotYourPasswordButton_Click(object sender, EventArgs e)
        {
            string enteredEmail = CustomBox.Input("Enter your Email");

            if (enteredEmail != null && enteredEmail.Contains('@'))
            {
                if (UserManager.PasswordRecovery(enteredEmail))
                {
                    CustomBox.Message($"Password successfully sent to: {enteredEmail}");
                    return;
                }
            }
            CustomBox.Message("Message could not be sent");
        }
        private bool SentConfirmationCode(User newUser)
        {
            string confirmationCode = Guid.NewGuid().ToString();

            if (UserManager.SentMailAsync(newUser, "GitHab Application - Registration", $"Confirmation code - {confirmationCode}").Result)
            {
                if (CustomBox.Input($"Confirmation code sent to {newUser.Email}") == confirmationCode)
                {
                    return(true);
                }

                else
                {
                    CustomBox.Message("Confirmation code is incorrect");
                }
            }
            else
            {
                CustomBox.Message("Message could not be sent");
            }

            return(false);
        }