feat: ( passenger ) wire IAM global guard, org seeder, and backoffice auth

This commit is contained in:
Abubeker Yasin
2026-06-23 14:25:10 +03:00
parent 707e32c43c
commit 1eaffa7ba0
17 changed files with 658 additions and 99 deletions

View File

@@ -1,5 +1,6 @@
import { Body, Controller, Post, HttpCode, HttpStatus, UseGuards, Get, Request, UnauthorizedException } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse, ApiBody, ApiBearerAuth } from '@nestjs/swagger';
import { IsPublic } from '@tria-plc/api-common/modules/auth/decorators/public.decorator';
import { PassengerAuthService } from './passenger-auth.service';
import { RegisterDto, LoginDto } from './auth.dto';
import { JwtGuard } from '../../common/jwt.guard';
@@ -10,6 +11,7 @@ export class AuthController {
constructor(private passengerAuthService: PassengerAuthService) {}
@Post('register')
@IsPublic()
@ApiOperation({ summary: 'Register new passenger account' })
@ApiResponse({ status: 201, description: 'Account created. Returns token + user.' })
@ApiResponse({ status: 409, description: 'Email or phone already registered' })
@@ -19,6 +21,7 @@ export class AuthController {
}
@Post('login')
@IsPublic()
@HttpCode(HttpStatus.OK)
@ApiOperation({ summary: 'Login with email and password' })
@ApiResponse({ status: 200, description: 'Login successful. Returns token + passengerId.' })