mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
support for cipher login uris and match detection
This commit is contained in:
@@ -27,22 +27,14 @@ export default class WebRequestBackground {
|
||||
return;
|
||||
}
|
||||
|
||||
const domain = this.platformUtilsService.getDomain(details.url);
|
||||
if (domain == null) {
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
this.pendingAuthRequests.push(details.requestId);
|
||||
|
||||
if (this.isFirefox) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
await this.resolveAuthCredentials(domain, resolve, reject);
|
||||
await this.resolveAuthCredentials(details.url, resolve, reject);
|
||||
});
|
||||
} else {
|
||||
await this.resolveAuthCredentials(domain, callback, callback);
|
||||
await this.resolveAuthCredentials(details.url, callback, callback);
|
||||
}
|
||||
}, { urls: ['http://*/*', 'https://*/*'] }, [this.isFirefox ? 'blocking' : 'asyncBlocking']);
|
||||
|
||||
@@ -54,7 +46,7 @@ export default class WebRequestBackground {
|
||||
|
||||
private async resolveAuthCredentials(domain: string, success: Function, error: Function) {
|
||||
try {
|
||||
const ciphers = await this.cipherService.getAllDecryptedForDomain(domain);
|
||||
const ciphers = await this.cipherService.getAllDecryptedForUrl(domain);
|
||||
if (ciphers == null || ciphers.length !== 1) {
|
||||
error();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user