fix reset hw endpoint

This commit is contained in:
Alex Bezdieniezhnykh
2025-05-02 11:17:45 +03:00
parent eb043e94a8
commit 0458739126
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -171,8 +171,8 @@ app.MapPost("/resources/get/{dataFolder?}", //Need to have POST method for secur
}).RequireAuthorization()
.WithOpenApi(op => new OpenApiOperation(op){ Summary = "Gets encrypted by users Password and HardwareHash resources. POST method for secure password"});
app.MapPut("/resources/reset-hardware",
async (string email, IUserService userService, ICache cache, CancellationToken cancellationToken) =>
app.MapPut("/resources/reset-hardware/{email}",
async ([FromRoute]string email, IUserService userService, ICache cache, CancellationToken cancellationToken) =>
await userService.UpdateHardware(email, cancellationToken: cancellationToken))
.RequireAuthorization(apiAdminPolicy)
.WithOpenApi(op => new OpenApiOperation(op){ Summary = "Resets hardware id in case of hardware change"});
+1
View File
@@ -31,6 +31,7 @@ public enum ExceptionEnum
[Description("Password should be at least 8 characters.")]
PasswordLengthIncorrect = 32,
[Description("Email is empty or invalid.")]
EmailLengthIncorrect = 35,
WrongEmail = 37,