Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2025-02-28 12:33:47 +00:00
parent 5ee122cdae
commit e4dac2a210
No known key found for this signature in database
GPG Key ID: A2B008A5F49F5D0D
2 changed files with 6 additions and 6 deletions

@ -7,7 +7,7 @@ Please see LICENSE files in the repository root for full details.
import { app, autoUpdater, desktopCapturer, ipcMain, powerSaveBlocker, TouchBar, nativeImage } from "electron"; import { app, autoUpdater, desktopCapturer, ipcMain, powerSaveBlocker, TouchBar, nativeImage } from "electron";
import { relaunchApp } from "@standardnotes/electron-clear-data"; import { relaunchApp } from "@standardnotes/electron-clear-data";
import * as keytar from "keytar"; import keytar from "keytar";
import IpcMainEvent = Electron.IpcMainEvent; import IpcMainEvent = Electron.IpcMainEvent;
import { recordSSOSession } from "./protocol.js"; import { recordSSOSession } from "./protocol.js";
@ -141,11 +141,11 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
case "getPickleKey": case "getPickleKey":
try { try {
ret = await keytar?.getPassword("element.io", `${args[0]}|${args[1]}`); ret = await keytar.getPassword("element.io", `${args[0]}|${args[1]}`);
// migrate from riot.im (remove once we think there will no longer be // migrate from riot.im (remove once we think there will no longer be
// logins from the time of riot.im) // logins from the time of riot.im)
if (ret === null) { if (ret === null) {
ret = await keytar?.getPassword("riot.im", `${args[0]}|${args[1]}`); ret = await keytar.getPassword("riot.im", `${args[0]}|${args[1]}`);
} }
} catch { } catch {
// if an error is thrown (e.g. keytar can't connect to the keychain), // if an error is thrown (e.g. keytar can't connect to the keychain),
@ -169,10 +169,10 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
case "destroyPickleKey": case "destroyPickleKey":
try { try {
await keytar?.deletePassword("element.io", `${args[0]}|${args[1]}`); await keytar.deletePassword("element.io", `${args[0]}|${args[1]}`);
// migrate from riot.im (remove once we think there will no longer be // migrate from riot.im (remove once we think there will no longer be
// logins from the time of riot.im) // logins from the time of riot.im)
await keytar?.deletePassword("riot.im", `${args[0]}|${args[1]}`); await keytar.deletePassword("riot.im", `${args[0]}|${args[1]}`);
} catch {} } catch {}
break; break;
case "getDesktopCapturerSources": case "getDesktopCapturerSources":

@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details.
import { app, ipcMain } from "electron"; import { app, ipcMain } from "electron";
import { promises as afs } from "node:fs"; import { promises as afs } from "node:fs";
import path from "node:path"; import path from "node:path";
import * as keytar from "keytar"; import keytar from "keytar";
import type { import type {
Seshat as SeshatType, Seshat as SeshatType,