FIX: send origin removing http prefix

This commit is contained in:
marcos-silva-rodrigues
2025-04-14 08:45:59 -03:00
parent 0a5f138829
commit f4b8addda4
+3 -2
View File
@@ -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<AuthSignInRes> {
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);
}