From d9b5da5cf3cd648baca76ce3b8057038af851e96 Mon Sep 17 00:00:00 2001 From: Stefan Pejcic Date: Tue, 13 Feb 2024 11:15:04 +0100 Subject: [PATCH] Update index.tsx --- documentation/src/pages/verify/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/documentation/src/pages/verify/index.tsx b/documentation/src/pages/verify/index.tsx index 5b99a8dd..3bd17834 100644 --- a/documentation/src/pages/verify/index.tsx +++ b/documentation/src/pages/verify/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import Head from "@docusaurus/Head"; import { BlogFooter } from "@site/src/refine-theme/blog-footer"; import { CommonHeader } from "@site/src/refine-theme/common-header"; @@ -19,6 +19,17 @@ const Verify: React.FC = () => { } }; + useEffect(() => { + // Check if there's an 'ip' parameter in the URL + const urlParams = new URLSearchParams(window.location.search); + const urlIpAddress = urlParams.get('ip'); + + if (urlIpAddress) { + setIpAddress(urlIpAddress); + handleCheckLicense(); // Automatically check the license if IP is present in the URL + } + }, []); // Empty dependency array ensures it only runs once on component mount + return (