1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 14:23:32 +00:00

normalize username detection

This commit is contained in:
Kyle Spearrin
2019-12-26 07:51:16 -05:00
parent 86e3374d3d
commit f02c44decf
2 changed files with 7 additions and 2 deletions

2
jslib

Submodule jslib updated: 57e49207e9...98c7dc1626

View File

@@ -285,8 +285,13 @@ export default class RuntimeBackground {
return; return;
} }
if (loginInfo.username != null) {
loginInfo.username = loginInfo.username.toLowerCase();
}
const ciphers = await this.cipherService.getAllDecryptedForUrl(loginInfo.url); const ciphers = await this.cipherService.getAllDecryptedForUrl(loginInfo.url);
const usernameMatches = ciphers.filter((c) => c.login.username === loginInfo.username); const usernameMatches = ciphers.filter((c) =>
c.login.username != null && c.login.username.toLowerCase() === loginInfo.username);
if (usernameMatches.length === 0) { if (usernameMatches.length === 0) {
const disabledAddLogin = await this.storageService.get<boolean>( const disabledAddLogin = await this.storageService.get<boolean>(
ConstantsService.disableAddLoginNotificationKey); ConstantsService.disableAddLoginNotificationKey);