Skip to content

Commit

Permalink
Add: function api key level auth-z
Browse files Browse the repository at this point in the history
  • Loading branch information
antidoid committed Mar 2, 2024
1 parent 7e2b9e7 commit e8ef418
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit e8ef418

Please sign in to comment.