From f4b8addda4121fef2c4c02167c35983c2c62a0ec Mon Sep 17 00:00:00 2001 From: marcos-silva-rodrigues Date: Mon, 14 Apr 2025 08:45:59 -0300 Subject: [PATCH] FIX: send origin removing http prefix --- src/modules/auth/auth.controller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 163ec64..b31ada8 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -88,10 +88,11 @@ export class AuthController { async signIn( @Body() { username, password, totp }: AuthSignInReq, @Language() language: LanguageEnum, - @Headers('host') host: string + @Headers('origin') origin: string ): Promise { this.logger.info('/auth - SignIn'); - const metadata = PackTheMetadata({ language, custom_host: host }); + const frontHost = origin.replace(/^https?:\/\//, ''); + const metadata = PackTheMetadata({ language, custom_host: frontHost }); this.logger.info('metadata: ' + JSON.stringify(metadata.toJSON())); return this.authClient.signIn({ username, password, totp }, metadata); }