1
0
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:
Kyle Spearrin
2018-03-02 12:04:21 -05:00
parent ced108d1a6
commit c27f5836bf
6 changed files with 13 additions and 29 deletions

View File

@@ -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;