Files
indee-demo/backend/src/auth/guards/jwt.guard.ts
Dorian cdd24a5def Implement backend API and database services in Docker setup
- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO.
- Introduced PostgreSQL and Redis services with health checks and configurations for data persistence.
- Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets.
- Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage.
- Enhanced the Dockerfile to support the new API environment variables and configurations.
- Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 20:14:39 +00:00

28 lines
792 B
TypeScript

import {
ExecutionContext,
Injectable,
Logger,
UnauthorizedException,
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
/**
* JWT Auth Guard stub.
* Cognito JWT verification has been removed.
* This guard now always rejects -- all auth should go through
* NostrSessionJwtGuard or NostrAuthGuard via the HybridAuthGuard.
*
* Kept for API compatibility with endpoints that still reference JwtAuthGuard.
*/
@Injectable()
export class JwtAuthGuard extends AuthGuard('jwt') {
async canActivate(context: ExecutionContext): Promise<boolean> {
Logger.warn(
'JwtAuthGuard.canActivate called -- Cognito is disabled. Use Nostr auth.',
);
throw new UnauthorizedException(
'Cognito authentication is disabled. Use Nostr login.',
);
}
}