Skip to content

feat(admin)!: no default admin; password hashing comes from @dune/core - #11

Merged
zumbrunn merged 2 commits into
mainfrom
feat/core-credentials-no-default-admin
Nov 3, 2026
Merged

zumbrunn merged 2 commits into
mainfrom
feat/core-credentials-no-default-admin

Conversation

@zumbrunn

@zumbrunn zumbrunn commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Refs duneorg/dune#69 (step 3 of the plan in the issue)

Core 0.35.3 (with duneorg/dune#84 and #86) is published; the range is ^0.35.3.

What

  • BREAKING: no default admin. ensureDefaultAdmin(), generatePassword() and the plaintext initial-password.txt are removed. The first admin is an explicit act: dune users:create <email> --role admin --password-prompt, or DUNE_ADMIN_EMAIL + DUNE_ADMIN_PASSWORD at boot (core). A site with no enabled admin logs a warning with the exact command. Sites that already have an admin are unaffected.
  • Hashing from core. The plugin's src/admin/auth/passwords.ts is deleted; login.tsx, local-provider.ts and users.ts import @dune/core/auth/passwords. hashPassword, verifyPassword and DUMMY_HASH are still re-exported from the admin entry point. Hash format unchanged.
  • Fixed a stale "a new default admin will be created" message in the legacy users-directory warning.
  • Tests: default-admin tests replaced by a check that none is created implicitly; generatePassword bias test dropped with the function.

Release notes for the release

Version: 3.3.0 (decided 2026-11-03: core loads the built-in admin through ^3.0, so a 4.x would need a second core release; first-run behaviour for new sites changes, existing sites with an admin are unaffected). dune new scaffolds and getting-started docs still need updating (step 4 in #69).

Testing

237 tests pass, deno check clean, check:core-imports run. deno fmt --check already fails repo-wide (159 files), so nothing was reformatted. The no-admin warning path was not exercised end to end.

🤖 Generated with Claude Code

zumbrunn and others added 2 commits November 3, 2026 16:15
BREAKING: ensureDefaultAdmin() and the plaintext initial-password.txt are
removed. The first admin is an explicit act: `dune users:create <email> --role
admin --password-prompt`, or DUNE_ADMIN_EMAIL / DUNE_ADMIN_PASSWORD at boot
(handled by @dune/core). A site with no enabled admin logs a warning saying how
to create one. Sites that already have an admin are unaffected.

Password hashing now comes from @dune/core/auth/passwords; the plugin's own
copy is removed. hashPassword, verifyPassword and DUMMY_HASH are still
re-exported from the admin entry point. The hash format is unchanged.

Requires @dune/core 0.35.3 (duneorg/dune#84, #86). Refs duneorg/dune#69.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@zumbrunn
zumbrunn marked this pull request as ready for review November 3, 2026 15:45
@zumbrunn
zumbrunn merged commit 621aced into main Nov 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant