mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 08:31:49 +00:00
fix: harden app lock system unlock flow
This commit is contained in:
1 parent
f6a49dbf0a
commit
0ea707f70f
14 files changed
+114
-26
No files matched your search
@@ -383,8 +383,11 @@ function createAppLockController({
|
||||
return saved;
|
||||
}
|
||||
|
||||
async function requestReset() {
|
||||
async function requestReset(currentPassword) {
|
||||
const current = getSettings();
|
||||
const verified = await verifyCurrentPassword(current, currentPassword);
|
||||
if (verified !== true) return verified;
|
||||
|
||||
const saved = await saveSettings({
|
||||
enabled: false,
|
||||
timeoutMinutes: current.timeoutMinutes,
|
||||
@@ -547,7 +550,8 @@ function createAppLockController({
|
||||
ipcMain.handle("netcatty:appLock:requestEnable", () => requestEnable());
|
||||
ipcMain.handle("netcatty:appLock:requestDisable", (_event, currentPassword) =>
|
||||
requestDisable(currentPassword));
|
||||
ipcMain.handle("netcatty:appLock:requestReset", () => requestReset());
|
||||
ipcMain.handle("netcatty:appLock:requestReset", (_event, currentPassword) =>
|
||||
requestReset(currentPassword));
|
||||
ipcMain.handle("netcatty:appLock:requestPasswordChange", (_event, input) =>
|
||||
requestPasswordChange(input));
|
||||
ipcMain.handle("netcatty:appLock:setLocked", (_event, reason) => setLocked(reason));
|
||||
|
||||
Reference in new issue
Block a user