Esempio n. 1
0
        internal static async Task <ConfirmEmail> ConfirmEmailAsync(IdentityEmail email, HttpClient client)
        {
            var emailBody   = HtmlAssert.IsHtmlFragment(email.Body);
            var linkElement = HtmlAssert.HasElement("a", emailBody);
            var link        = Assert.IsAssignableFrom <IHtmlAnchorElement>(linkElement);

            return(await ConfirmEmail.Create(link, client, new DefaultUIContext()
                                             .WithAuthenticatedUser()
                                             .WithExistingUser()
                                             .WithConfirmedEmail()));
        }
Esempio n. 2
0
        private async Task LoadAsync(UserData user)
        {
            var email = await _userManager.GetEmailAsync(user).ConfigureAwait(true);

            Email = email;

            Input = new IdentityEmail
            {
                NewEmail = email,
            };

            IsEmailConfirmed = await _userManager.IsEmailConfirmedAsync(user).ConfigureAwait(true);
        }
Esempio n. 3
0
    internal static async Task <ResetPasswordConfirmation> ResetPasswordAsync(HttpClient client, IdentityEmail resetPasswordEmail, string email, string newPassword)
    {
        var emailBody   = HtmlAssert.IsHtmlFragment(resetPasswordEmail.Body);
        var linkElement = HtmlAssert.HasElement("a", emailBody);
        var link        = Assert.IsAssignableFrom <IHtmlAnchorElement>(linkElement);

        var resetPassword = await ResetPassword.CreateAsync(link, client, new DefaultUIContext().WithExistingUser());

        return(await resetPassword.SendNewPasswordAsync(email, newPassword));
    }