mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix(proxy): improve auth validation during validity check
This commit is contained in:
@@ -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<string | null> {
|
||||
logger.debug(`Validating ${this.config.credentials}`);
|
||||
|
||||
BuiltinProxy.validateAuth(this.config.credentials);
|
||||
|
||||
if (this.config.publicIp) {
|
||||
|
||||
Reference in New Issue
Block a user