import { a as getActiveLoginMethod, d as needsBootstrap, n as disableOpenID } from "../chunks/account-db-Ou9GhEjB.js";
import { t as promptPassword } from "../chunks/prompt-BzK0flle.js";
//#region src/scripts/disable-openid.js
if (needsBootstrap()) {
	console.log("System needs to be bootstrapped first. OpenID is not enabled.");
	process.exit(1);
} else {
	console.log("To disable OpenID, you have to enter your server password:");
	try {
		const loginMethod = getActiveLoginMethod();
		console.log(`Current login method: ${loginMethod}`);
		if (loginMethod === "password") {
			console.log("OpenID already disabled.");
			process.exit(0);
		}
		const { error } = await disableOpenID({ password: await promptPassword() }) || {};
		if (error) {
			console.log("Error disabling OpenID:", error);
			console.log("Please report this as an issue: https://github.com/actualbudget/actual-server/issues");
			process.exit(2);
		}
		console.log("OpenID disabled!");
		console.log("Note: you will need to log in with the password on any browsers or devices that are currently logged in.");
	} catch (err) {
		console.log("Unexpected error:", err);
		console.log("Please report this as an issue: https://github.com/actualbudget/actual-server/issues");
		process.exit(2);
	}
}
//#endregion
export {};

//# sourceMappingURL=disable-openid.js.map