feat: replace placeholder auth with db hash

This commit is contained in:
2026-01-14 13:44:26 +01:00
parent b706a9ce14
commit bf913012ac
3 changed files with 89 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
-- Users table for authentication
CREATE TABLE users (
id BINARY(16) NOT NULL PRIMARY KEY,
username VARCHAR(50) NOT NULL UNIQUE,
password_hash VARCHAR(255) NOT NULL,
email VARCHAR(255),
created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- Create index on username for faster lookups
CREATE INDEX idx_username ON users(username);
-- Insert default admin user (password: password)
-- bcrypt hash of "password"
INSERT INTO users (id, username, password_hash, email)
VALUES (
UUID_TO_BIN(UUID()),
'admin',
'$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy',
'admin@example.com'
);