DeutschLernen/GermanApp
Lasse Rune Hansen ef72cbea18 fix(backend/auth): Fix JWT token claim mapping for user ID
- Changed AuthService.GenerateJwtToken to use JWT standard claims:
  - JwtRegisteredClaimNames.Sub for user ID (instead of ClaimTypes.NameIdentifier)
  - JwtRegisteredClaimNames.Name for username
  - JwtRegisteredClaimNames.Email for email
  - JwtRegisteredClaimNames.UniqueName for additional username claim
  - Kept ClaimTypes.Role for role

- Updated AuthController.GetCurrentUser to use JwtRegisteredClaimNames.Sub
- Updated AdminController.DeleteUserAsync to use JwtRegisteredClaimNames.Sub

This fixes the 401 error when calling /me after login. The issue was that
tokens were being generated with ClaimTypes.NameIdentifier claim, but the
JWT middleware doesn't automatically map this to a claim that can be found
with User.FindFirst(). Using standard JWT claims (sub, name, email) ensures
proper compatibility with ASP.NET Core's JWT authentication.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 17:38:27 +02:00
..
Application feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
Domain fix(backend/auth): Fix authentication bugs 2026-06-14 16:40:01 +02:00
Infrastructure fix(backend/auth): Fix JWT token claim mapping for user ID 2026-06-14 17:38:27 +02:00
Presentation fix(backend/auth): Fix JWT token claim mapping for user ID 2026-06-14 17:38:27 +02:00
Properties Initial commit: GermanApp with Clean Architecture 2026-05-31 18:14:51 +02:00
Shared feat(backend/infra): add health checks, CORS, Serilog logging, and exception middleware 2026-05-31 19:52:00 +02:00
.dockerignore feat(backend/infra): add Docker configuration for Phase 3 2026-06-05 11:46:27 +02:00
Dockerfile fix(infra): remove problematic health checks for now 2026-06-05 13:03:10 +02:00
GermanApp.csproj feat(backend/infrastructure): implement Mistral API Connector (Phase 0 of AI Services) 2026-06-09 18:56:37 +02:00
GermanApp.http Initial commit: GermanApp with Clean Architecture 2026-05-31 18:14:51 +02:00
Program.cs fix(backend/auth): Fix authentication bugs 2026-06-14 16:40:01 +02:00