diff --git a/api/src/core/sso/sso-setup.ts b/api/src/core/sso/sso-setup.ts index 5eb8dcdd7..9ffdd3b00 100755 --- a/api/src/core/sso/sso-setup.ts +++ b/api/src/core/sso/sso-setup.ts @@ -1,6 +1,10 @@ import { existsSync } from 'node:fs'; import { copyFile, readFile, rename, unlink, writeFile } from 'node:fs/promises'; + + + + export const setupSso = async () => { const path = '/usr/local/emhttp/plugins/dynamix/include/.login.php'; @@ -52,11 +56,11 @@ function verifyUsernamePasswordAndSSO(string $username, string $password): bool '!verifyUsernamePasswordAndSSO($username, $password)' ); - // Inject the PHP include tag before the closing tag - fileContent = fileContent.replace(/<\/body>/i, `${tagToInject}\n`); + // Inject the PHP include tag after the closing tag + fileContent = fileContent.replace(/<\/form>/i, `\n${tagToInject}`); // Write the updated content back to the file await writeFile(path, fileContent); console.log('Function replaced successfully.'); -}; +}; \ No newline at end of file