mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 10:39:40 +02:00
- 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
29 lines
777 B
TypeScript
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';
|