From c852f24a72d9ad4baefb7125e45fd0fefebf87e2 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 14 Jan 2026 08:53:48 -0800 Subject: [PATCH] fix(auth-service): add 'auth/' prefix to controller routes for Kong compatibility Kong routes /api/v2/auth/* to auth-service without stripping the path, so controllers need 'auth/' prefix to match frontend requests: - SmsController: 'sms' -> 'auth/sms' - PasswordController: 'password' -> 'auth/password' - UserController: 'user' -> 'auth/user' Co-Authored-By: Claude Opus 4.5 --- .../auth-service/src/api/controllers/password.controller.ts | 2 +- .../services/auth-service/src/api/controllers/sms.controller.ts | 2 +- .../auth-service/src/api/controllers/user.controller.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/services/auth-service/src/api/controllers/password.controller.ts b/backend/services/auth-service/src/api/controllers/password.controller.ts index 807b2ac8..d7f91242 100644 --- a/backend/services/auth-service/src/api/controllers/password.controller.ts +++ b/backend/services/auth-service/src/api/controllers/password.controller.ts @@ -22,7 +22,7 @@ class ChangePasswordDto { newPassword: string; } -@Controller('password') +@Controller('auth/password') @UseGuards(ThrottlerGuard) export class PasswordController { constructor(private readonly passwordService: PasswordService) {} diff --git a/backend/services/auth-service/src/api/controllers/sms.controller.ts b/backend/services/auth-service/src/api/controllers/sms.controller.ts index 5e7d3894..7fa2f668 100644 --- a/backend/services/auth-service/src/api/controllers/sms.controller.ts +++ b/backend/services/auth-service/src/api/controllers/sms.controller.ts @@ -21,7 +21,7 @@ class VerifySmsDto { type: 'REGISTER' | 'LOGIN' | 'RESET_PASSWORD' | 'CHANGE_PHONE'; } -@Controller('sms') +@Controller('auth/sms') @UseGuards(ThrottlerGuard) export class SmsController { constructor(private readonly smsService: SmsService) {} diff --git a/backend/services/auth-service/src/api/controllers/user.controller.ts b/backend/services/auth-service/src/api/controllers/user.controller.ts index eafaecea..cd183053 100644 --- a/backend/services/auth-service/src/api/controllers/user.controller.ts +++ b/backend/services/auth-service/src/api/controllers/user.controller.ts @@ -7,7 +7,7 @@ import { UserService, UserProfileResult } from '@/application/services'; import { JwtAuthGuard } from '@/shared/guards/jwt-auth.guard'; import { CurrentUser } from '@/shared/decorators/current-user.decorator'; -@Controller('user') +@Controller('auth/user') @UseGuards(JwtAuthGuard) export class UserController { constructor(private readonly userService: UserService) {}