update & fix typing, updated examples

This commit is contained in:
dswbx
2024-12-23 19:28:31 +01:00
parent 70e42a02d7
commit c1e92e503b
21 changed files with 126 additions and 139 deletions

View File

@@ -1,6 +1,7 @@
import { password as $password, text as $text } from "@clack/prompts";
import type { App } from "App";
import type { BkndConfig } from "adapter";
import type { PasswordStrategy } from "auth/authenticate/strategies";
import type { App, BkndConfig } from "bknd";
import { makeConfigApp } from "cli/commands/run";
import { getConfigPath } from "cli/commands/run/platform";
import type { CliCommand } from "cli/types";
@@ -37,7 +38,7 @@ async function action(action: "create" | "update", options: any) {
async function create(app: App, options: any) {
const config = app.module.auth.toJSON(true);
const strategy = app.module.auth.authenticator.strategy("password") as PasswordStrategy;
const users_entity = config.entity_name;
const users_entity = config.entity_name as "users";
const email = await $text({
message: "Enter email",
@@ -83,7 +84,7 @@ async function create(app: App, options: any) {
async function update(app: App, options: any) {
const config = app.module.auth.toJSON(true);
const strategy = app.module.auth.authenticator.strategy("password") as PasswordStrategy;
const users_entity = config.entity_name;
const users_entity = config.entity_name as "users";
const em = app.modules.ctx().em;
const email = (await $text({