fix(identity): corrige JWT role claims, password policy, et consistency

- JWT role claims: string.Join -> ClaimTypes.Role individuels (debloque [Authorize(Roles)])\n- Password policy: RequireUppercase=true, RequireNonAlphanumeric=true\n- JWT validation params extraits en methode partagee (anti-duplication)\n- Retours 401 uniformises avec body structure\n- Champ Langue ajoute dans le dialog d'edition utilisateur\n\nBuild: 0 errors, 0 warnings\nTests: 226/226 passed
This commit is contained in:
Arnaud Dartois committed 2026-07-21 08:47:24 +00:00
1 parent af8c7aa037
commit 940e826865
6 files changed
+38 -33

No files matched your search

@@ -86,7 +86,7 @@ public class AuthController : ControllerBase
{
var userIdClaim = User.FindFirstValue(ClaimTypes.NameIdentifier);
if (userIdClaim is null || !Guid.TryParse(userIdClaim, out var userId))
return Unauthorized();
return Unauthorized(new { error = "Invalid user identity" });
var result = await _authService.ChangePasswordAsync(
userId, request.CurrentPassword, request.NewPassword, ct);
@@ -120,7 +120,7 @@ public class AuthController : ControllerBase
{
var userIdClaim = User.FindFirstValue(ClaimTypes.NameIdentifier);
if (userIdClaim is null || !Guid.TryParse(userIdClaim, out var userId))
return Unauthorized();
return Unauthorized(new { error = "Invalid user identity" });
await _authService.LogoutAsync(userId, request.RefreshToken, ct);
return Ok();