From 80e028c0d9b7d013539474ddfc1f53030ab7a665 Mon Sep 17 00:00:00 2001 From: Tomas R Date: Thu, 28 Nov 2024 15:11:28 -0300 Subject: [PATCH] validate types in next --- dapps/appkit-siwe/next/app/config/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dapps/appkit-siwe/next/app/config/index.tsx b/dapps/appkit-siwe/next/app/config/index.tsx index 08d76327b..447e4c945 100644 --- a/dapps/appkit-siwe/next/app/config/index.tsx +++ b/dapps/appkit-siwe/next/app/config/index.tsx @@ -73,6 +73,10 @@ export const siweConfig = createSIWEConfig({ } const { address, chainId } = session as unknown as SIWESession; + // Validate address and chainId types + if (typeof address !== "string" || typeof chainId !== "number") { + return null; + } return { address, chainId }; },