- Add PUT /users/me/password inline handler in routes_users.go (the existing handler in internal/api/user/ was never registered) - Create migration 975 adding two_factor_enabled, two_factor_secret, and backup_codes columns to users table (fixes 500 on 2FA endpoints) Fixes: Settings bugs #1 (password 404), #2/#4 (2FA 500) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 lines
511 B
SQL
8 lines
511 B
SQL
-- Migration 975: Add two-factor authentication columns to users table
|
|
-- Required by internal/services/two_factor_service.go
|
|
|
|
ALTER TABLE public.users ADD COLUMN IF NOT EXISTS two_factor_enabled BOOLEAN NOT NULL DEFAULT false;
|
|
ALTER TABLE public.users ADD COLUMN IF NOT EXISTS two_factor_secret TEXT DEFAULT '';
|
|
ALTER TABLE public.users ADD COLUMN IF NOT EXISTS backup_codes TEXT DEFAULT '';
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_users_two_factor ON public.users(two_factor_enabled) WHERE two_factor_enabled = true;
|