Exemplo n.º 1
0
        private async Task ChangePassword(ChangePasswordViewModel context)
        {
            var res = await _userManager.ChangePasswordAsync(_identityManager.GetCurrentIdentity().GetUserId().ToGuid(),
                                                             context.CurrentPassword, context.NewPassword);

            if (!res.Succeeded)
            {
                throw new InvalidOperationException(string.Join(",", res.Errors));
            }
        }