@base44-preview/cli 0.0.47-pr.422.cab311c → 0.0.47-pr.422.d37d331
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +12 -16
- package/dist/cli/index.js.map +5 -5
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -250632,7 +250632,7 @@ function validateAction(action) {
|
|
|
250632
250632
|
});
|
|
250633
250633
|
}
|
|
250634
250634
|
}
|
|
250635
|
-
async function passwordLoginAction(action) {
|
|
250635
|
+
async function passwordLoginAction({ log }, action) {
|
|
250636
250636
|
validateAction(action);
|
|
250637
250637
|
const shouldEnable = action === "enable";
|
|
250638
250638
|
const { project: project2 } = await readProjectConfig();
|
|
@@ -250645,7 +250645,7 @@ async function passwordLoginAction(action) {
|
|
|
250645
250645
|
return merged;
|
|
250646
250646
|
});
|
|
250647
250647
|
if (!shouldEnable && !hasAnyLoginMethod(updated)) {
|
|
250648
|
-
|
|
250648
|
+
log.warn("Disabling password auth will leave no login methods enabled. Users will be locked out.");
|
|
250649
250649
|
}
|
|
250650
250650
|
const newStatus = shouldEnable ? "enabled" : "disabled";
|
|
250651
250651
|
return {
|
|
@@ -250653,14 +250653,12 @@ async function passwordLoginAction(action) {
|
|
|
250653
250653
|
};
|
|
250654
250654
|
}
|
|
250655
250655
|
function getPasswordLoginCommand() {
|
|
250656
|
-
return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(
|
|
250657
|
-
return passwordLoginAction(action);
|
|
250658
|
-
});
|
|
250656
|
+
return new Base44Command("password-login").description("Enable or disable username & password authentication").argument("<enable|disable>", "enable or disable password authentication").action(passwordLoginAction);
|
|
250659
250657
|
}
|
|
250660
250658
|
|
|
250661
250659
|
// src/cli/commands/auth/pull.ts
|
|
250662
250660
|
import { dirname as dirname9, join as join14 } from "node:path";
|
|
250663
|
-
async function pullAuthAction() {
|
|
250661
|
+
async function pullAuthAction({ log }) {
|
|
250664
250662
|
const { project: project2 } = await readProjectConfig();
|
|
250665
250663
|
const configDir = dirname9(project2.configPath);
|
|
250666
250664
|
const authDir = join14(configDir, project2.authDir);
|
|
@@ -250677,9 +250675,9 @@ async function pullAuthAction() {
|
|
|
250677
250675
|
errorMessage: "Failed to sync auth config file"
|
|
250678
250676
|
});
|
|
250679
250677
|
if (written) {
|
|
250680
|
-
|
|
250678
|
+
log.success("Auth config written to local file");
|
|
250681
250679
|
} else {
|
|
250682
|
-
|
|
250680
|
+
log.info("Auth config is already up to date");
|
|
250683
250681
|
}
|
|
250684
250682
|
return {
|
|
250685
250683
|
outroMessage: `Pulled auth config to ${authDir} (overwrites local file)`
|
|
@@ -250690,19 +250688,19 @@ function getAuthPullCommand() {
|
|
|
250690
250688
|
}
|
|
250691
250689
|
|
|
250692
250690
|
// src/cli/commands/auth/push.ts
|
|
250693
|
-
async function pushAuthAction(
|
|
250691
|
+
async function pushAuthAction({ isNonInteractive, log }, options) {
|
|
250694
250692
|
const { authConfig } = await readProjectConfig();
|
|
250695
250693
|
if (authConfig.length === 0) {
|
|
250696
|
-
|
|
250694
|
+
log.info("No local auth config found");
|
|
250697
250695
|
return {
|
|
250698
250696
|
outroMessage: "No auth config to push. Run `base44 auth pull` to fetch the remote config first."
|
|
250699
250697
|
};
|
|
250700
250698
|
}
|
|
250701
250699
|
if (!hasAnyLoginMethod(authConfig[0])) {
|
|
250702
|
-
|
|
250700
|
+
log.warn("This config has no login methods enabled. Pushing it will lock out all users.");
|
|
250703
250701
|
}
|
|
250704
250702
|
if (!options.yes) {
|
|
250705
|
-
if (
|
|
250703
|
+
if (isNonInteractive) {
|
|
250706
250704
|
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
250707
250705
|
}
|
|
250708
250706
|
const shouldPush = await Re({
|
|
@@ -250723,9 +250721,7 @@ async function pushAuthAction(options, command2) {
|
|
|
250723
250721
|
};
|
|
250724
250722
|
}
|
|
250725
250723
|
function getAuthPushCommand() {
|
|
250726
|
-
return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(
|
|
250727
|
-
return await pushAuthAction(options, command2);
|
|
250728
|
-
});
|
|
250724
|
+
return new Base44Command("push").description("Push local auth config to Base44").option("-y, --yes", "Skip confirmation prompt").action(pushAuthAction);
|
|
250729
250725
|
}
|
|
250730
250726
|
|
|
250731
250727
|
// src/cli/commands/auth/index.ts
|
|
@@ -260130,4 +260126,4 @@ export {
|
|
|
260130
260126
|
CLIExitError
|
|
260131
260127
|
};
|
|
260132
260128
|
|
|
260133
|
-
//# debugId=
|
|
260129
|
+
//# debugId=8E32344696FF6C3D64756E2164756E21
|