feat: Implement user profile management, add multi-language interactive transcripts, and lay groundwork for SSO.

This commit is contained in:
2026-01-17 00:26:42 -03:00
parent ffbef17396
commit b166387a48
26 changed files with 2646 additions and 469 deletions
@@ -0,0 +1,5 @@
-- Add profile fields to users table
ALTER TABLE users
ADD COLUMN IF NOT EXISTS avatar_url TEXT,
ADD COLUMN IF NOT EXISTS bio TEXT,
ADD COLUMN IF NOT EXISTS language VARCHAR(10);
@@ -0,0 +1,24 @@
-- Migration: Add SSO Configuration support for organizations
CREATE TABLE IF NOT EXISTS organization_sso_configs (
organization_id UUID PRIMARY KEY REFERENCES organizations(id) ON DELETE CASCADE,
issuer_url TEXT NOT NULL,
client_id TEXT NOT NULL,
client_secret TEXT NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Index for performance (already PRIMARY KEY, but let's be explicit if needed)
CREATE INDEX IF NOT EXISTS sso_configs_org_id_idx ON organization_sso_configs (organization_id);
-- Migration: Add temporary storage for OIDC states
CREATE TABLE IF NOT EXISTS sso_states (
state_token TEXT PRIMARY KEY,
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
nonce TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Cleanup old states after 1 hour (intended for batch cleanup, but table is small anyway)
CREATE INDEX IF NOT EXISTS sso_states_created_at_idx ON sso_states (created_at);