feat: secure KYC storage, Google OAuth, terms gating

This commit is contained in:
arifal
2026-04-28 23:10:21 +07:00
parent 58da4608ac
commit 05d0929f7a
41 changed files with 3087 additions and 262 deletions
+11 -6
View File
@@ -2,6 +2,7 @@ import "dotenv/config";
import { PrismaClient } from "../app/generated/prisma/client";
import { PrismaPg } from "@prisma/adapter-pg";
import bcrypt from "bcryptjs";
import { encryptString, hmacHex } from "../lib/crypto";
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL!,
@@ -97,16 +98,19 @@ async function main() {
// ==================== ORGANIZER VERIFICATIONS ====================
const verifiedAt = new Date();
const dedeNik = "3201010101010001";
const panjiNik = "3201010101010002";
await prisma.organizerVerification.createMany({
data: [
{
userId: dede.id,
fullName: "Dede Inoen",
nik: "3201010101010001",
nikEncrypted: encryptString(dedeNik),
nikHash: hmacHex(dedeNik),
birthDate: new Date(Date.UTC(1990, 0, 1)),
address: "Jl. Pendaki No. 1, Garut, Jawa Barat",
ktpImageUrl: "https://placehold.co/600x400/png?text=KTP+Dede",
selfieUrl: "https://placehold.co/600x400/png?text=Selfie+Dede",
ktpImageKey: "ktp/seed-dede.jpg",
selfieKey: "selfie/seed-dede.jpg",
bankName: "BCA",
bankAccountNumber: "1234567890",
bankAccountName: "Dede Inoen",
@@ -117,11 +121,12 @@ async function main() {
{
userId: panji.id,
fullName: "Panji Petualang",
nik: "3201010101010002",
nikEncrypted: encryptString(panjiNik),
nikHash: hmacHex(panjiNik),
birthDate: new Date(Date.UTC(1985, 5, 15)),
address: "Jl. Adventure No. 7, Kuningan, Jawa Barat",
ktpImageUrl: "https://placehold.co/600x400/png?text=KTP+Panji",
selfieUrl: "https://placehold.co/600x400/png?text=Selfie+Panji",
ktpImageKey: "ktp/seed-panji.jpg",
selfieKey: "selfie/seed-panji.jpg",
bankName: "Mandiri",
bankAccountNumber: "9876543210",
bankAccountName: "Panji Petualang",