Skip to content

Auth: Bootstrap admin script #124

@EricGrill

Description

@EricGrill

Auth System — Step 5 (Backend)

Create the first admin user (can't use invite flow — no one to invite from).

Implementation:

  • backend/scripts/create-admin.js CLI script
  • Usage: node scripts/create-admin.js --email admin@cafejusto.app --password "..."
  • Creates user with admin role (farm_id = NULL)
  • Alternatively: auto-create from BOOTSTRAP_ADMIN_EMAIL + BOOTSTRAP_ADMIN_PASSWORD env vars if users table is empty on startup
  • Refuse to run if admin already exists (prevent duplicates)

Depends on: DB migration
Design doc: docs/AUTH.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions