sciagent code + Gitea Actions CI/CD
CI/CD / backend (push) Failing after 2m8s
CI/CD / frontend (push) Failing after 1m40s
CI/CD / deploy (push) Has been skipped

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Thinh Lam
2026-06-30 09:38:30 +07:00
commit 688fac73e9
1167 changed files with 158244 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
-- Registration email verification via 6-digit OTP (replaces magic-link issuance on register).
-- Apply after 013_email_verification.sql:
-- docker exec -i initiative-postgres psql -U initiative -d initiatives < be0/migrations/014_registration_otp.sql
CREATE TABLE IF NOT EXISTS registration_otp_codes (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
otp_hash TEXT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,
failed_attempts INT NOT NULL DEFAULT 0,
used_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_registration_otp_codes_user_pending
ON registration_otp_codes (user_id)
WHERE used_at IS NULL;
COMMENT ON TABLE registration_otp_codes IS
'Hashed 6-digit OTP for register verification; pending rows deleted when superseded by resend.';