Huge updates

This commit is contained in:
MarcWieland
2026-06-24 22:29:05 +02:00
parent 94c10aebdd
commit 0d59d521dc
12 changed files with 559 additions and 40 deletions
+11
View File
@@ -243,6 +243,16 @@ usersApi.MapPut("/{userId:int}/rename", async (int userId, [FromBody] RenameRequ
return Results.Ok();
});
usersApi.MapPut("/{userId:int}/change-password", async (int userId, [FromBody] ChangePasswordRequest req, IAuthService authService) =>
{
var error = await authService.ChangePasswordAsync(userId, req.CurrentPassword, req.NewPassword);
if (error != null)
{
return Results.BadRequest(error);
}
return Results.Ok();
});
// ── Timetracker-API-Endpoints (Protected) ─────────────────────────────────────
var trackerApi = app.MapGroup("/api/tracker").RequireAuthorization();
@@ -362,3 +372,4 @@ app.Run();
public record LoginRequest(string Username, string Password);
public record RegisterRequest(string Username, string Password, string? Honeypot = null);
public record RenameRequest(string Username);
public record ChangePasswordRequest(string CurrentPassword, string NewPassword);