Feature: Implemented Secure Merchant Vault Architecture with On-chain segregation and Encryption

This commit is contained in:
mstfyldz
2026-03-12 23:22:52 +03:00
parent b4dff13c94
commit 889eff49c8
5 changed files with 185 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
} from 'lucide-react';
import MerchantSidebar from '@/components/merchant/MerchantSidebar';
import { db } from '@/lib/db';
import { ensureMerchantVaults } from '@/lib/vault-manager';
export default async function MerchantLayout({
children,
@@ -33,6 +34,15 @@ export default async function MerchantLayout({
}
}
// Ensure vaults exist for this merchant
if (resolvedId) {
try {
await ensureMerchantVaults(resolvedId);
} catch (err) {
console.error('[MerchantLayout] Vault sync failed:', err);
}
}
// 2. Auth Check
const isAuth = cookieStore.get(`merchant_auth_${resolvedId}`);
const isShortAuth = cookieStore.get(`merchant_auth_${identifier}`);