示例#1
0
    public async Task <IActionResult> ChangePasswordAsync([FromBody] ChangePasswordDto input)
    {
        // Act.
        if (!await _signInService.CheckPasswordAsync(_appContext.UserId, input.OldPassword))
        {
            throw new InvalidCredentialException();
        }

        await _signInService.SetPasswordAsync(_appContext.UserId, input.NewPassword);

        // Return.
        return(NoContent());
    }