Skip to content

Commit

Permalink
fix: auth issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Mar 13, 2024
1 parent bb84f63 commit e12206e
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/bidiMapper/domains/network/NetworkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,22 @@ export class NetworkProcessor {
Network.InterceptPhase.ResponseStarted,
]);

if (
params.credentials &&
request.interceptPhase === Network.InterceptPhase.AuthRequired
) {
await Promise.all([
request.waitNextPhase,
request.continueWithAuth({
if (request.interceptPhase === Network.InterceptPhase.AuthRequired) {
if (params.credentials) {
await Promise.all([
request.waitNextPhase,
request.continueWithAuth({
response: 'ProvideCredentials',
username: params.credentials.username,
password: params.credentials.password,
}),
]);
} else {
// We need to use `ProvideCredentials`
// As `Default` may cancel the request
await request.continueWithAuth({
response: 'ProvideCredentials',
username: params.credentials.username,
password: params.credentials.password,
}),
]);

if (
// If the credentials were wrong just return
// TODO: clarify if we should fail in such case
request.interceptPhase === Network.InterceptPhase.AuthRequired
) {
});
return {};
}
}
Expand Down

0 comments on commit e12206e

Please sign in to comment.