From 1854aa9f28e306aea4ddfad56db9dc29fb70464e Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 22 Jan 2025 16:15:36 -0500 Subject: [PATCH] fix: dont remove login file without a backup presetn --- api/src/core/sso/sso-remove.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/api/src/core/sso/sso-remove.ts b/api/src/core/sso/sso-remove.ts index c3e73323e..390f03426 100644 --- a/api/src/core/sso/sso-remove.ts +++ b/api/src/core/sso/sso-remove.ts @@ -4,13 +4,12 @@ export const removeSso = () => { const path = '/usr/local/emhttp/plugins/dynamix/include/.login.php'; const backupPath = path + '.bak'; - // Remove the SSO login inject file if it exists - if (existsSync(path)) { - unlinkSync(path); - } - // Move the backup file to the original location if (existsSync(backupPath)) { + // Remove the SSO login inject file if it exists + if (existsSync(path)) { + unlinkSync(path); + } renameSync(backupPath, path); }