Adds profile and settings pages

This commit is contained in:
2026-06-22 23:59:04 +02:00
parent 6976eb4337
commit 2544e20b3c
49 changed files with 2741 additions and 34 deletions
@@ -77,6 +77,19 @@ public class AuthService : IAuthService
}
}
public async Task ChangePasswordAsync(Guid userId, string currentPassword, string newPassword)
{
var user = await _userManager.FindByIdAsync(userId.ToString())
?? throw new UnauthorizedException("Gebruiker niet gevonden.");
var result = await _userManager.ChangePasswordAsync(user, currentPassword, newPassword);
if (!result.Succeeded)
{
var errors = string.Join(", ", result.Errors.Select(e => e.Description));
throw new ValidationException(errors);
}
}
private async Task<TokenResponse> GenerateTokenResponseAsync(ApplicationUser user)
{
var roles = await _userManager.GetRolesAsync(user);