From e8ef418c6ca4515038a2ee8d54be22a383278b67 Mon Sep 17 00:00:00 2001 From: antidoid Date: Sat, 2 Mar 2024 09:32:37 +0530 Subject: [PATCH] Add: function api key level auth-z --- frontend/src/App.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 8e64880..c0018de 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -14,15 +14,6 @@ function App() { const [isLoading, setIsLoading] = useState(false); - useEffect(() => { - // Add query params to request url as users fill the form - setRequestUrl( - `${ - import.meta.env.VITE_FUNCTION_URL - }?url=${qrCodeUrl}&color=${color}&style=${style}`, - ); - }, [qrCodeUrl, color, style]); - const handleDownloadBtn = async () => { setIsLoading(true); @@ -34,6 +25,9 @@ function App() { }); try { + const requesturl = `${import.meta.env.VITE_FUNCTION_URL + }?url=${qrCodeUrl}&color=${color}&style=${style} + &code=${import.meta.env.VITE_FUNCTION_API_KEY}`; const res = await fetch(requesturl); const { qr_code_url: imgLink } = await res.json(); setImgUrl(imgLink);