Feature: Implemented Secure Merchant Vault Architecture with On-chain segregation and Encryption
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user