From 29dd38d4820004a49e8af47c68b131beafca9fb4 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Sun, 12 Oct 2025 20:39:24 +0100 Subject: [PATCH] fix(proxy): improve auth validation during validity check --- packages/core/src/proxy/builtin.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/proxy/builtin.ts b/packages/core/src/proxy/builtin.ts index 0507dfae..3e970a87 100644 --- a/packages/core/src/proxy/builtin.ts +++ b/packages/core/src/proxy/builtin.ts @@ -27,10 +27,11 @@ export class BuiltinProxy extends BaseProxy { } if ( - Env.AIOSTREAMS_AUTH?.has(username) && - Env.AIOSTREAMS_AUTH?.get(username) !== password + !Env.AIOSTREAMS_AUTH || + !Env.AIOSTREAMS_AUTH.has(username) || + Env.AIOSTREAMS_AUTH.get(username) !== password ) { - throw new Error('Invalid credentials'); + throw new Error('Invalid credentials.'); } return { @@ -60,6 +61,8 @@ export class BuiltinProxy extends BaseProxy { } public override async getPublicIp(): Promise { + logger.debug(`Validating ${this.config.credentials}`); + BuiltinProxy.validateAuth(this.config.credentials); if (this.config.publicIp) {