create-kontrolia-auth 2.4.4 → 2.4.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/steps/deployment.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AA+K7F;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAwJvG"}
1
+ {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/steps/deployment.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AA+K7F;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAkMvG"}
@@ -1,6 +1,7 @@
1
1
  import * as p from "@clack/prompts";
2
2
  import { readEnvFile, updateEnvValue, writeEnvFile } from "../utils/files.js";
3
3
  import { registerOAuthClient } from "../utils/oauth-client.js";
4
+ import { extractProjectRef } from "../utils/supabase-management-api.js";
4
5
  import { createVercelProject, detectCurrentBranch, detectGitHubRepo, triggerVercelDeployment } from "../utils/vercel-api.js";
5
6
  /**
6
7
  * Catches a `http://` URL for a real domain before it gets baked into env
@@ -228,6 +229,43 @@ export async function askDeploymentStep(repoRoot, db) {
228
229
  "auth-server y admin-panel comparten dominio (o subdominios con NEXT_PUBLIC_COOKIE_DOMAIN). " +
229
230
  "Si en el futuro necesitas dominios completamente distintos, habilita esa opción en tu proyecto y vuelve a correr el instalador.", "Paso manual pendiente");
230
231
  }
232
+ // Optional: lets admin-panel's "Inicio de sesión social" screen activate
233
+ // Google/Microsoft login live via Supabase's Management API instead of
234
+ // requiring a dashboard visit. Only possible on a Supabase Cloud project
235
+ // (self-hosted has no equivalent API) — skipped entirely otherwise.
236
+ const projectRef = extractProjectRef(db.supabaseUrl);
237
+ let managementApiToken = "";
238
+ if (projectRef) {
239
+ const prevToken = prevAuthServerEnv?.SUPABASE_MANAGEMENT_API_TOKEN;
240
+ if (prevToken) {
241
+ const reuseToken = await p.confirm({
242
+ message: "Ya tengo guardado un Personal Access Token de Supabase de antes (para activar login social en vivo desde admin-panel) — ¿lo sigo usando?",
243
+ initialValue: true,
244
+ });
245
+ if (!p.isCancel(reuseToken) && reuseToken)
246
+ managementApiToken = prevToken;
247
+ }
248
+ if (!managementApiToken) {
249
+ const wantsSocialLogin = await p.confirm({
250
+ message: "¿Quieres poder activar el login con Google/Microsoft más adelante desde admin-panel " +
251
+ "(Configuración → Inicio de sesión social), sin entrar al dashboard de Supabase? Es opcional — " +
252
+ "se puede configurar después. Necesita un Personal Access Token de tu cuenta Supabase.",
253
+ initialValue: false,
254
+ });
255
+ if (!p.isCancel(wantsSocialLogin) && wantsSocialLogin) {
256
+ p.note("1. Entra a supabase.com/dashboard/account/tokens\n" +
257
+ '2. Dale click a "Generate new token"\n' +
258
+ "3. Ponle un nombre, confirma y cópialo (solo se ve una vez)\n" +
259
+ "4. Pégalo aquí abajo", "Cómo conseguir el Personal Access Token de Supabase");
260
+ const token = await p.password({
261
+ message: "Personal Access Token de Supabase (se guarda en tu .env.local, igual que el resto de tus llaves)",
262
+ validate: (value) => (value.trim() ? undefined : "Requerido"),
263
+ });
264
+ if (!p.isCancel(token))
265
+ managementApiToken = token;
266
+ }
267
+ }
268
+ }
231
269
  const s = p.spinner();
232
270
  s.start("Generando apps/auth-server/.env.local y apps/admin-panel/.env.local");
233
271
  const authServerEnv = {
@@ -237,6 +275,7 @@ export async function askDeploymentStep(repoRoot, db) {
237
275
  SUPABASE_SERVICE_ROLE_KEY: db.serviceRoleKey,
238
276
  NEXT_PUBLIC_ADMIN_PANEL_URL: adminPanelUrl,
239
277
  NEXT_PUBLIC_COOKIE_DOMAIN: cookieDomain,
278
+ SUPABASE_MANAGEMENT_API_TOKEN: managementApiToken,
240
279
  };
241
280
  await writeEnvFile(`${repoRoot}/apps/auth-server/.env.local`, authServerEnv);
242
281
  const adminPanelEnv = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kontrolia-auth",
3
- "version": "2.4.4",
3
+ "version": "2.4.6",
4
4
  "license": "MIT",
5
5
  "description": "Turnkey installer for KontrolIA Auth. `npx create-kontrolia-auth mi-app` checks requirements, downloads the repo, installs deps, and runs a wizard: (1) connect to an existing Supabase project or create a new self-hosted one via Docker; (2) where to deploy auth-server/admin-panel (Docker, Vercel, Railway, Render, Coolify). Also exposes `update`, `migrate` and `doctor` subcommands.",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@clack/prompts": "^0.9.1",
37
37
  "jose": "^5.9.6",
38
- "@kontrolia/db": "2.1.2"
38
+ "@kontrolia/db": "2.1.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^22.10.2",