DeutschLernen/GermanApp/Presentation/Controllers
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
..
AdminController.cs fix(backend/auth): Fix JWT token claim mapping for user ID 2026-06-14 17:38:27 +02:00
AuthController.cs fix(backend/auth): Fix JWT token claim mapping for user ID 2026-06-14 17:38:27 +02:00
BootstrapController.cs feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
LessonsController.cs feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
LevelsController.cs feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
MistralController.cs feat(backend/ai-services): Complete AI Services Phase 0-4 implementation 2026-06-13 10:09:19 +02:00
QuizQuestionsController.cs feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
QuizzesController.cs feat(backend): Implement mandatory authentication and admin module 2026-06-14 12:42:15 +02:00
SpeechController.cs feat(backend/ai-services): Complete AI Services Phase 0-4 implementation 2026-06-13 10:09:19 +02:00
StoryController.cs feat(docs/admin): Add Admin Module feature specification and update roadmap 2026-06-14 11:45:55 +02:00
TtsController.cs feat(backend/ai-services): Complete AI Services Phase 0-4 implementation 2026-06-13 10:09:19 +02:00