Add user accounts, roles, and admin gating

- Scaffold password auth (email or username) with phx.gen.auth; no magic links
- Add role (member/moderator/admin/super_admin) and plan (free/premium) enums
- Gate /admin behind admin-or-above via plug + on_mount; hide the nav link
- Add mix accounts.promote for CLI role changes
- Disable email confirmation by confirming accounts at registration

Closes #3
This commit is contained in:
2026-11-03 15:48:50 +01:00
parent 3b527d21ed
commit 7cb7298236
35 changed files with 3464 additions and 9 deletions
@@ -10,6 +10,8 @@ defmodule ChesstrainerWeb.EndgameLive.FormTest do
@fen "8/8/3k4/8/8/3K1R2/8/8 w - - 0 1"
setup :register_and_log_in_admin
describe "rating default" do
test "new endgame form pre-fills rating with 1500", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin/endgames/new")