Added initial authorization layer.

This commit is contained in:
2026-10-09 17:22:46 +02:00
parent 7fb3abc93d
commit 1f6de34e5b
16 changed files with 184 additions and 64 deletions
@@ -1,5 +1,7 @@
CREATE TABLE tokens (
id UUID PRIMARY KEY DEFAULT gen_random_uuid (),
user_id UUID NOT NULL CONSTRAINT fk_tokens_user REFERENCES users (id) ON DELETE CASCADE,
user_app_id UUID CONSTRAINT fk_tokens_app REFERENCES user_apps (id) ON DELETE CASCADE,
access_token_hash BYTEA NOT NULL UNIQUE CHECK (
octet_length(access_token_hash) = 32
),