public async Task <IActionResult> ChangePassword(ChangePasswordIdentityTemplate template)
        {
            Guid identityId = _currentIdentityProvider.Id;

            PasswordAdto passwordAdto = await _identityApplicationService.ChangePasswordAsync(new ChangePasswordAdto
            {
                IdentityId      = identityId,
                Password        = template.Password,
                ConfirmPassword = template.ConfirmPassword,
                Version         = template.Version
            });

            return(Accepted(_resourceBuilder.Build(new ChangePasswordResource
            {
                Id = passwordAdto.IdentityId
            })));
        }
 public Task <PasswordAdto> ChangePasswordAsync(ChangePasswordAdto changePasswordAdto)
 {
     return(_securityApplicationService.SecureAsync(() => _identityApplicationService.ChangePasswordAsync(changePasswordAdto),
                                                    IdentityAuthorisationContext.Create(changePasswordAdto.IdentityId, AuthorisationAction.Update)));
 }