From 5c740420e9524509c38de470b3cc89e97e0f673f Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 26 Jun 2026 22:11:29 -0500 Subject: [PATCH] fix: return JSON body from send-otp endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flutter client calls jsonDecode on response body — empty void response throws FormatException even when SMS was sent successfully. Co-Authored-By: Claude Sonnet 4.6 --- backend/src/auth/auth.controller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/auth/auth.controller.ts b/backend/src/auth/auth.controller.ts index 3eda804..c1b7e65 100644 --- a/backend/src/auth/auth.controller.ts +++ b/backend/src/auth/auth.controller.ts @@ -55,8 +55,9 @@ export class AuthController { } @Post('send-otp') - sendOtp(@Body() dto: SendOtpDto) { - return this.auth.sendPhoneOtp(dto.phone); + async sendOtp(@Body() dto: SendOtpDto) { + await this.auth.sendPhoneOtp(dto.phone); + return { ok: true }; } @Post('phone')