New public page GET/POST /request-access explains what a signed-in reader account gets (complete issues online, EPUB/XTC downloads, no ratings or admin tools) and takes an email plus an optional reason. A honeypot field drops bots and a partial unique index keeps one open request per email, updating it on resubmit. Open requests show on /dashboard/users with a "Mark done" button and as a tile on the overview; accounts are still created with the daily-epub users CLI. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QVPagF6jfDv78CC5Jv2wp4
13 lines
466 B
SQL
13 lines
466 B
SQL
CREATE TABLE account_requests (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
email TEXT NOT NULL COLLATE NOCASE,
|
|
reason TEXT,
|
|
status TEXT NOT NULL CHECK (status IN ('open', 'done')) DEFAULT 'open',
|
|
requested_at TEXT NOT NULL,
|
|
handled_at TEXT,
|
|
handled_by INTEGER REFERENCES users(id) ON DELETE SET NULL
|
|
);
|
|
|
|
CREATE UNIQUE INDEX idx_account_requests_open_email
|
|
ON account_requests(email) WHERE status = 'open';
|