Implement AsciiDoc and TipTap conversion logic, including new Admonition node and CodeBlock extension; add DiffViewer and HistoryPanel components for document version comparison; introduce password hashing utility with SHA-256.
This commit is contained in:
@@ -57,6 +57,13 @@ func (d *DB) init() error {
|
||||
return err
|
||||
}
|
||||
|
||||
// HasUsers returns true if at least one user account exists.
|
||||
func (d *DB) HasUsers() bool {
|
||||
var n int
|
||||
d.sql.QueryRow(`SELECT COUNT(*) FROM users`).Scan(&n)
|
||||
return n > 0
|
||||
}
|
||||
|
||||
// CreateUser inserts a new user. Returns ErrUserExists if the username is taken.
|
||||
func (d *DB) CreateUser(username, passHash, role string) error {
|
||||
_, err := d.sql.Exec(
|
||||
|
||||
Reference in New Issue
Block a user