Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Remove console.log (#541)

Leendert de Borst59627ebe3296
diff --git a/browser-extensions/chrome/eslint.config.js b/browser-extensions/chrome/eslint.config.js
index 6c40c0e59..8aaa5c6d1 100644
--- a/browser-extensions/chrome/eslint.config.js
+++ b/browser-extensions/chrome/eslint.config.js
@@ -39,6 +39,7 @@ export default [
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 1, "maxBOF": 0 }],
+ "no-console": ["error", { allow: ["warn", "error", "info", "debug"] }],
"jsdoc/require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": true,
diff --git a/browser-extensions/chrome/src/App.tsx b/browser-extensions/chrome/src/App.tsx
index caabb70b3..c4862e036 100644
--- a/browser-extensions/chrome/src/App.tsx
+++ b/browser-extensions/chrome/src/App.tsx
@@ -13,7 +13,7 @@ import './styles/app.css';
*/
function base64Encode(buffer: Uint8Array): string | null {
if (!buffer || typeof buffer !== 'object') {
- console.log('Empty or invalid buffer received');
+ console.error('Empty or invalid buffer received');
return null;
}
diff --git a/browser-extensions/chrome/src/background.ts b/browser-extensions/chrome/src/background.ts
index e66e65a17..002faba2e 100644
--- a/browser-extensions/chrome/src/background.ts
+++ b/browser-extensions/chrome/src/background.ts
@@ -3,8 +3,6 @@ import EncryptionUtility from './utils/EncryptionUtility';
import SqliteClient from './utils/SqliteClient';
import { Credential } from './types/Credential';
-console.log('Background script initialized');
-
let vaultState: {
sessionKey: string | null;
} = {
@@ -13,7 +11,6 @@ let vaultState: {
// Listen for messages from popup
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
- console.log('Received message:', message.type);
switch (message.type) {
case 'STORE_VAULT': {
// Generate random session key
@@ -46,7 +43,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
}
case 'GET_VAULT': {
if (!vaultState.sessionKey) {
- console.log('No session key available');
+ console.error('No session key available');
sendResponse({ vault: null });
return;
}
@@ -87,12 +84,10 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
}
case 'GET_CREDENTIALS_FOR_URL': {
- console.log('GET_CREDENTIALS_FOR_URL called');
if (!vaultState.sessionKey) {
sendResponse({ credentials: [] });
return;
}
- console.log('sessionKey:', vaultState.sessionKey);
chrome.storage.session.get(['encryptedVault'], async (result) => {
try {
@@ -127,8 +122,6 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
GROUP BY c.Id, c.Username, c.ServiceId, s.Name, s.Url, s.Logo
`);
- console.log('credentials:', credentials);
-
// Filter credentials that match the current domain
/*
* const matchingCredentials = credentials.filter(cred => {
diff --git a/browser-extensions/chrome/src/contentScript.ts b/browser-extensions/chrome/src/contentScript.ts
index 88b1d38d4..b182fd0f9 100644
--- a/browser-extensions/chrome/src/contentScript.ts
+++ b/browser-extensions/chrome/src/contentScript.ts
@@ -1,8 +1,6 @@
import { detectForms } from './utils/FormDetector';
import { Credential } from './types/Credential';
-console.log('Content script loaded!'); // This will help verify the script is running
-
const placeholderBase64 = 'UklGRjoEAABXRUJQVlA4IC4EAAAwFwCdASqAAIAAPpFCm0olo6Ihp5IraLASCWUA0eb/0s56RrLtCnYfLPiBshdXWMx8j1Ez65f169iA4xUDBTEV6ylMQeCIj2b7RngGi7gKZ9WjKdSoy9R8JcgOmjCMlDmLG20KhNo/i/Dc/Ah5GAvGfm8kfniV3AkR6fxN6eKwjDc6xrDgSfS48G5uGV6WzQt24YAVlLSK9BMwndzfHnePK1KFchFrL7O3ulB8cGNCeomu4o+l0SrS/JKblJ4WTzj0DAD++lCUEouSfgRKdiV2TiYCD+H+l3tANKSPQFPQuzi7rbvxqGeRmXB9kDwURaoSTTpYjA9REMUi9uA6aV7PWtBNXgUzMLowYMZeos6Xvyhb34GmufswMHA5ZyYpxzjTphOak4ZjNOiz8aScO5ygiTx99SqwX/uL+HSeVOSraHw8IymrMwm+jLxqN8BS8dGcItLlm/ioulqH2j4V8glDgSut+ExkxiD7m8TGPrrjCQNJbRDzpOFsyCyfBZupvp8QjGKW2KGziSZeIWes4aTB9tRmeEBhnUrmTDZQuXcc67Fg82KHrSfaeeOEq6jjuUjQ8wUnzM4Zz3dhrwSyslVz/WvnKqYkr4V/TTXPFF5EjF4rM1bHZ8bK63EfTnK41+n3n4gEFoYP4mXkNH0hntnYcdTqiE7Gn+q0BpRRxnkpBSZlA6Wa70jpW0FGqkw5e591A5/H+OV+60WAo+4Mi+NlsKrvLZ9EiVaPnoEFZlJQx1fA777AJ2MjXJ4KSsrWDWJi1lE8yPs8V6XvcC0chDTYt8456sKXAagCZyY+fzQriFMaddXyKQdG8qBqcdYjAsiIcjzaRFBBoOK9sU+sFY7N6B6+xtrlu3c37rQKkI3O2EoiJOris54EjJ5OFuumA0M6riNUuBf/MEPFBVx1JRcUEs+upEBsCnwYski7FT3TTqHrx7v5AjgFN97xhPTkmVpu6sxRnWBi1fxIRp8eWZeFM6mUcGgVk1WeVb1yhdV9hoMo2TsNEPE0tHo/wvuSJSzbZo7wibeXM9v/rRfKcx7X93rfiXVnyQ9f/5CaAQ4lxedPp/6uzLtOS4FyL0bCNeZ6L5w+AiuyWCTDFIYaUzhwfG+/YTQpWyeZCdQIKzhV+3GeXI2cxoP0ER/DlOKymf1gm+zRU3sqf1lBVQ0y+mK/Awl9bS3uaaQmI0FUyUwHUKP7PKuXnO+LcwDv4OfPT6hph8smc1EtMe5ib/apar/qZ9dyaEaElALJ1KKxnHziuvVl8atk1fINSQh7OtXDyqbPw9o/nGIpTnv5iFmwmWJLis2oyEgPkJqyx0vYI8rjkVEzKc8eQavAJBYSpjMwM193Swt+yJyjvaGYWPnqExxKiNarpB2WSO7soCAZXhS1uEYHryrK47BH6W1dRiruqT0xpLih3MXiwU3VDwAAAA==';
// Listen for input field focus
@@ -17,16 +15,13 @@ document.addEventListener('focusin', (e) => {
* Show credential popup
*/
function showCredentialPopup(input: HTMLInputElement) : void {
- console.log('showCredentialPopup called');
const forms = detectForms();
if (!forms.length) return;
// Request credentials from background script
chrome.runtime.sendMessage({ type: 'GET_CREDENTIALS_FOR_URL', url: window.location.href }, (response) => {
- console.log('response received:', response);
if (!response.credentials?.length) return;
- console.log('credentials received, creating popup:');
createPopup(input, response.credentials);
});
}
@@ -74,7 +69,6 @@ function createPopup(input: HTMLInputElement, credentials: Credential[]) : void
// Handle base64 image data
if (cred.Logo) {
const base64Logo = base64Encode(cred.Logo);
- console.log(base64Logo);
if (base64Logo) {
imgElement.src = `data:image/x-icon;base64,${base64Logo}`;
} else {
@@ -148,7 +142,7 @@ function triggerInputEvents(element: HTMLInputElement) : void {
*/
function base64Encode(buffer: Uint8Array): string | null {
if (!buffer || typeof buffer !== 'object') {
- console.log('Empty or invalid buffer received');
+ console.error('Empty or invalid buffer received');
return null;
}
diff --git a/browser-extensions/chrome/src/pages/Login.tsx b/browser-extensions/chrome/src/pages/Login.tsx
index 8c618581c..d65709224 100644
--- a/browser-extensions/chrome/src/pages/Login.tsx
+++ b/browser-extensions/chrome/src/pages/Login.tsx
@@ -45,10 +45,6 @@ const Login: React.FC = () => {
// Convert uint8 array to uppercase hex string which is expected by the server.
const passwordHashString = Buffer.from(passwordHash).toString('hex').toUpperCase();
- console.log('Password hash:');
- console.log(passwordHash);
- console.log(passwordHashString);
-
// 2. Validate login with SRP protocol
const validationResponse = await srpUtil.validateLogin(
credentials.username,
@@ -68,17 +64,9 @@ const Login: React.FC = () => {
// Make another API call trying to get latest vault
const vaultResponseJson = await webApi.get('Vault') as VaultResponse;
- console.log('Vault response:')
- console.log('--------------------------------');
- console.log(vaultResponseJson);
- console.log('Encrypted blob:');
- console.log(vaultResponseJson.vault.blob);
-
// Attempt to decrypt the blob
const passwordHashBase64 = Buffer.from(passwordHash).toString('base64');
const decryptedBlob = await EncryptionUtility.symmetricDecrypt(vaultResponseJson.vault.blob, passwordHashBase64);
- console.log('Decrypted blob:');
- console.log(decryptedBlob);
// Initialize the SQLite context with decrypted data
await dbContext.initializeDatabase(decryptedBlob);