managarten/packages/shared-nestjs-auth/src/index.ts
Wuesteon 942c588e15 🔒️ feat(auth): centralize JWT validation via mana-core-auth
- Create @manacore/shared-nestjs-auth package with JwtAuthGuard
- Update @mana-core/nestjs-integration to validate tokens via auth service
- Replace insecure local JWT decode with server-side validation
- Integrate Zitare, Presi, ManaDeck backends with centralized auth
- Add DEV_BYPASS_AUTH support for development mode
- Document auth architecture in CLAUDE.md
2025-12-01 17:16:21 +01:00

29 lines
777 B
TypeScript

/**
* @manacore/shared-nestjs-auth
*
* Shared authentication utilities for NestJS backends.
* Validates JWT tokens via the central Mana Core Auth service.
*
* @example
* ```typescript
* import { JwtAuthGuard, CurrentUser, CurrentUserData } from '@manacore/shared-nestjs-auth';
*
* @Controller('api')
* @UseGuards(JwtAuthGuard)
* export class MyController {
* @Get('profile')
* getProfile(@CurrentUser() user: CurrentUserData) {
* return { userId: user.userId, email: user.email };
* }
* }
* ```
*/
// Guards
export { JwtAuthGuard } from './guards/jwt-auth.guard';
// Decorators
export { CurrentUser } from './decorators/current-user.decorator';
// Types
export type { CurrentUserData, AuthModuleConfig, TokenValidationResponse } from './types';