Commit Graph
2 Commits
Author SHA1 Message Date
Arnaud Dartois ba985ed3c2 fix(auth): RegisterAdmin — [Authorize] + feature flag auth.admin-registration.enabled
#14: Remplacé le guard environment (Testing/Development) par:
- [Authorize(Policy = "AdminUsers")] sur l'endpoint
- Feature flag auth.admin-registration.enabled en DB (default: absent = disabled)
- Suppression de la dependance IWebHostEnvironment du controller
- Test mis a jour: bootstrap via register normal, puis flag, puis RegisterAdmin
2026-07-28 14:57:28 +00:00
Arnaud Dartois d0da78188a test(auth): add integration tests for authentication redirect flow
Add AuthFlowTests to catch Blazor redirect bugs:
- Get_Root_WithoutAuth_RedirectsToLogin: unauthenticated GET /
  must redirect to /login (would have caught the /Account/Login bug)
- Get_LoginPage_ReturnsOk: verify login page renders
- Get_ProtectedApi_WithoutAuth_ReturnsUnauthorized: API auth check
- RegisterAdmin_ThenLogin_ReturnsJwt_AndAccessesProtectedApi:
  full auth flow with JWT token refresh
- Register_WithWeakPassword_ReturnsBadRequest: password validation
- Register_ReturnsValidAuthResponse: success path
2026-07-24 19:39:47 +00:00