@podosoft/podokit 0.10.2 → 0.11.1
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/templates/fullstack-nest-svelte/apps/api/package.json +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/package.json +1 -1
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/app.d.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/account-data.server.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/i18n/messages.ts +16 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/server/search-indexing.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/+layout.server.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/settings/+page.server.ts +1 -1
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/settings/+page.svelte +7 -1
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/users/+page.svelte +36 -3
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/login/+page.server.ts +7 -4
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/login/+page.svelte +66 -3
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/pending-approval/+page.svelte +18 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/signup/+page.server.ts +12 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/signup/+page.svelte +11 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/+layout.server.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/auth-config.api.spec.ts +79 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/users-admin.api.spec.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/auth.ui.spec.ts +44 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/settings.ui.spec.ts +1 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/users.ui.spec.ts +43 -0
- package/dist/templates/modules/admin-dashboard/module.manifest.json +4 -4
- package/dist/templates/modules/audit-log/module.manifest.json +1 -1
- package/dist/templates/modules/auth/files/apps/api/scripts/configure-auth.mjs +187 -0
- package/dist/templates/modules/auth/files/apps/api/src/account/account.controller.ts +1 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/auth.ts +62 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth-config/auth-config.service.ts +13 -4
- package/dist/templates/modules/auth/files/dot-claude/skills/podokit-configure-auth/SKILL.md +93 -0
- package/dist/templates/modules/auth/files/dot-claude/skills/podokit-configure-auth/agents/openai.yaml +4 -0
- package/dist/templates/modules/auth/files/dot-claude/skills/podokit-configure-auth/references/apple.md +18 -0
- package/dist/templates/modules/auth/files/dot-claude/skills/podokit-configure-auth/references/google.md +19 -0
- package/dist/templates/modules/auth/files/dot-claude/skills/podokit-configure-auth/references/smtp.md +22 -0
- package/dist/templates/modules/auth/module.manifest.json +9 -6
- package/dist/templates/modules/mailer/module.manifest.json +1 -1
- package/dist/templates/todo/apps/api/package.json +1 -1
- package/dist/templates/todo/apps/web/package.json +1 -1
- package/package.json +1 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"requires": ["mailer"],
|
|
5
5
|
"targetApp": "api",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@podosoft/podokit-auth": "^0.
|
|
8
|
-
"@podosoft/podokit-contracts": "^0.
|
|
7
|
+
"@podosoft/podokit-auth": "^0.2.0",
|
|
8
|
+
"@podosoft/podokit-contracts": "^0.2.0",
|
|
9
9
|
"better-auth": "^1.6.23",
|
|
10
10
|
"@thallesp/nestjs-better-auth": "^2.7.0",
|
|
11
11
|
"pg": "^8.12.0",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"@types/pg": "^8.11.10"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"migrate:all": "node dist/migrate"
|
|
20
|
+
"migrate:all": "node dist/migrate",
|
|
21
|
+
"auth:configure": "node scripts/configure-auth.mjs"
|
|
21
22
|
},
|
|
22
23
|
"env": [
|
|
23
24
|
"# \u2500\u2500 Auth (better-auth) \u2014 the only required secrets \u2500\u2500",
|
|
@@ -27,7 +28,7 @@
|
|
|
27
28
|
"BETTER_AUTH_SECRET=change-me-in-production-min-32-characters",
|
|
28
29
|
"BETTER_AUTH_URL=http://localhost:5002",
|
|
29
30
|
"# Everything below is OPTIONAL. OAuth providers, SMTP, and the server-enforced",
|
|
30
|
-
"# toggles (email verification, breached-password check, self-delete) \u2014 plus the",
|
|
31
|
+
"# toggles (email verification, sign-up approval, breached-password check, self-delete) \u2014 plus the",
|
|
31
32
|
"# feature flags \u2014 are configured on the admin Settings page, stored encrypted in",
|
|
32
33
|
"# the DB and applied live (no restart). These env vars still work as a fallback/",
|
|
33
34
|
"# override (e.g. for secrets-manager injection in production); the DB takes",
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
"# SMS_WEBHOOK_URL=http://localhost:8095/sms",
|
|
39
40
|
"# AUTH_HIBP=false",
|
|
40
41
|
"# AUTH_EMAIL_VERIFICATION=false",
|
|
42
|
+
"# AUTH_REQUIRE_SIGNUP_APPROVAL=false",
|
|
41
43
|
"# AUTH_ALLOW_DELETE=false",
|
|
42
44
|
"# GOOGLE_CLIENT_ID=",
|
|
43
45
|
"# GOOGLE_CLIENT_SECRET=",
|
|
@@ -104,7 +106,7 @@
|
|
|
104
106
|
"file": "AGENTS.md",
|
|
105
107
|
"marker": "<!-- podokit:end:agents-modules -->",
|
|
106
108
|
"optional": true,
|
|
107
|
-
"text": "### auth (better-auth)\n- The API is **secure by default**: every route needs a session except `/health` and `/api/auth/*`. Opt a route out with `@Public()`; read the user with `@Session()`.\n- Configure OAuth providers, SMTP, and the server toggles on the admin **Settings** page (DB-backed, applied live \u2014 not via env). Only `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` are required env vars.\n- Development setup: create auth tables with `npx @better-auth/cli migrate -y --config apps/api/src/auth/auth.ts`, then run TypeORM migrations. Production images can run both from compiled output with `npm run migrate:all`.\n"
|
|
109
|
+
"text": "### auth (better-auth)\n- The API is **secure by default**: every route needs a session except `/health` and `/api/auth/*`. Opt a route out with `@Public()`; read the user with `@Session()`.\n- Configure OAuth providers, SMTP, sign-up approval, and the other server toggles on the admin **Settings** page (DB-backed, applied live \u2014 not via env). Only `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` are required env vars.\n- Use `npm run auth:configure -w <app>-api -- ...` and `.claude/skills/podokit-configure-auth` to apply OAuth/SMTP credentials without committing secrets. The sign-up approval gate is provider-independent; do not add provider-specific approval checks.\n- Development setup: create auth tables with `npx @better-auth/cli migrate -y --config apps/api/src/auth/auth.ts`, then run TypeORM migrations. Production images can run both from compiled output with `npm run migrate:all`.\n"
|
|
108
110
|
}
|
|
109
111
|
],
|
|
110
112
|
"instructions": [
|
|
@@ -114,6 +116,7 @@
|
|
|
114
116
|
"After building a production image, run all Better Auth and TypeORM migrations: npm run migrate:all",
|
|
115
117
|
"Sign up: curl -c cookies.txt -XPOST localhost:5002/api/auth/sign-up/email -H 'content-type: application/json' -d '{\"email\":\"a@example.com\",\"password\":\"password123\",\"name\":\"A\"}'",
|
|
116
118
|
"Call a protected route with the session: curl -b cookies.txt localhost:5002/account/me",
|
|
117
|
-
"
|
|
119
|
+
"Use npm run auth:configure -w <app>-api -- --help for redacted OAuth, SMTP, and sign-up approval automation.",
|
|
120
|
+
"Everything is protected by default; mark public routes with @Public(). Configure OAuth providers, SMTP, and server-enforced toggles on the admin Settings page \u2014 stored encrypted in the DB and applied live (no restart). Environment variables (GOOGLE_CLIENT_*, SMTP_*, AUTH_*) still work as an optional fallback/override."
|
|
118
121
|
]
|
|
119
122
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"migration:generate": "npm run typeorm -- migration:generate"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@podosoft/podokit-contracts": "^0.
|
|
17
|
+
"@podosoft/podokit-contracts": "^0.2.0",
|
|
18
18
|
"@nestjs/common": "^11.1.27",
|
|
19
19
|
"@nestjs/config": "^4.0.4",
|
|
20
20
|
"@nestjs/core": "^11.1.27",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podosoft/podokit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "An opinionated but extensible starter toolkit and CLI for full-stack TypeScript apps with NestJS, SvelteKit, TailwindCSS, shadcn-svelte, Docker, and k3s.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|