No description
|
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
PROBLEM:
- Login returns JWT token with 'sub' claim
- /me endpoint tries to read user ID from JWT
- Gets 401 Unauthorized because user ID claim cannot be found
ROOT CAUSE:
ASP.NET Core JWT middleware automatically maps JWT standard claims to .NET claim types:
- JwtRegisteredClaimNames.Sub ('sub') -> ClaimTypes.NameIdentifier ('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier')
Controllers were looking for 'sub' or 'nameid' but JWT middleware creates the claim with the full URI.
SOLUTION:
Updated all controllers to use ClaimTypes.NameIdentifier with fallback to 'sub':
- AuthController.GetCurrentUser()
- AdminController.DeleteUserAsync()
- StoryController.GetUserId()
This ensures the user ID can be found regardless of how the JWT middleware maps the claims.
CHANGES:
- AuthService: Generates JWT tokens with JwtRegisteredClaimNames.Sub (JWT standard)
- AuthController: Uses ClaimTypes.NameIdentifier ?? 'sub' fallback
- AdminController: Uses ClaimTypes.NameIdentifier ?? 'sub' fallback
- StoryController: Uses ClaimTypes.NameIdentifier ?? 'sub' fallback
- LessonsEndpoints.cs: Added .RequireAuthorization() to all GET endpoints
- docs/features/admin-module.md: Updated acceptance criteria and requirements
- Added unit tests in JwtTokenValidationTests.cs to verify the fix
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
|
||
|---|---|---|
| docs | ||
| german-app-frontend | ||
| GermanApp | ||
| scripts/ai-setup | ||
| Tests | ||
| .dockerignore | ||
| .gitignore | ||
| .woodpecker.yml | ||
| AGENTS.md | ||
| docker-compose.yml | ||
| nuget.config | ||
DeutschLernen Documentation
Welcome to the documentation for the DeutschLernen solution. This directory contains all project documentation organized by category.
📚 Documentation Structure
docs/
├── README.md # This file - Table of Contents
│
├── architecture/ # System architecture & design
│ ├── application-plan.md # High-level application plan and vision
│ ├── backend-structure.md # Backend architecture and component structure
│ └── frontend-structure.md # Frontend architecture and component structure
│
├── database/ # Database-related documentation
│ └── initial-database-schema.sql # Initial SQL schema for the database
│
└── development/ # Development guides & setup
└── how-to-run-vibe.md # Guide for running Vibe CLI in this project
📖 Documentation Categories
Architecture 🏗️
| File | Description | Last Updated |
|---|---|---|
| application-plan.md | Overall application vision, features, and roadmap | - |
| backend-structure.md | Backend architecture, Clean Architecture layers, component diagrams | - |
| frontend-structure.md | Frontend architecture, React component structure, state management | - |
Database 🗃️
| File | Description | Last Updated |
|---|---|---|
| initial-database-schema.sql | SQL schema for database initialization, tables, relationships | - |
Development 🛠️
| File | Description | Last Updated |
|---|---|---|
| how-to-run-vibe.md | Instructions for setting up and using Vibe CLI with this project | - |
Feature Tracking
| File | Description | Last Updated |
|---|---|---|
| features/README.md | Feature implementation plans and progress tracking | - |
| features/template.md | Template for creating new feature plans | - |
📝 Adding New Documentation
When adding new documentation files, please follow these guidelines:
- Choose the right category: Place files in the appropriate subdirectory
- Use kebab-case naming:
new-document.mdnotNewDocument.md - Update this README: Add your file to the appropriate table above
- Keep it organized: Create new subdirectories if a category grows too large
Suggested Categories
architecture/- System design, component diagrams, technical decisionsdatabase/- Schema, migrations, data modelsdevelopment/- Setup guides, development workflows, toolingapi/- API documentation, endpoints, contracts (if not using Swagger)testing/- Test strategies, test data, test casesdeployment/- Deployment guides, CI/CD, infrastructurefeatures/- Feature specifications, user stories
🔍 Quick Links
- Application Plan - Start here for project vision
- Backend Structure - Clean Architecture implementation
- Database Schema - Database design
- Vibe Setup - Development environment setup
- Feature Tracking - Feature implementation plans & progress
💡 Tips
- Use the search functionality in your code editor to find specific topics across all docs
- Documentation should be just enough - focus on the "why" not just the "what"
- Keep documentation up to date with code changes
- For API documentation, rely on Swagger/OpenAPI where possible
Last updated: May 31, 2025 Need help? Check the AGENTS.md file for development rules and workflows