diff --git a/frontend/bun.lockb b/frontend/bun.lockb index c5a4643..a91a770 100755 Binary files a/frontend/bun.lockb and b/frontend/bun.lockb differ diff --git a/frontend/network/api.ts b/frontend/network/api.ts index 37988b8..0f906fb 100644 --- a/frontend/network/api.ts +++ b/frontend/network/api.ts @@ -48,11 +48,28 @@ export const api = axios.create({ api.interceptors.request.use(async (config) => { const auth = getAuth(); - const token = await auth.currentUser?.getIdToken(); - console.log("attaching token", token) + const user = auth.currentUser; + let token = null; + + if (user) { + try { + token = await user.getIdToken(); + console.log("Firebase token obtained successfully"); + console.log("token", token) + } catch (error) { + console.error("Error getting Firebase token:", error); + } + } else { + console.log("No current user found"); + } + if (token) { config.headers.Authorization = `Bearer ${token}`; + console.log("Authorization header set"); + } else { + console.log("No token available, request will be unauthorized"); } + return config; }, (error) => { return Promise.reject(error); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 9dcd59e..4c26f88 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -280,7 +280,6 @@ "version": "11.11.1", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz", "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==", - "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -300,6 +299,10 @@ } } }, + "node_modules/@clerk/clerk-js/node_modules/@emotion/react/node_modules/@emotion/weak-memoize": { + "version": "0.3.1", + "license": "MIT" + }, "node_modules/@clerk/clerk-react": { "version": "5.4.1", "license": "MIT", @@ -399,14 +402,16 @@ "stylis": "4.2.0" } }, + "node_modules/@emotion/cache/node_modules/@emotion/weak-memoize": { + "version": "0.3.1", + "license": "MIT" + }, "node_modules/@emotion/hash": { "version": "0.9.2", "license": "MIT" }, "node_modules/@emotion/is-prop-valid": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.3.0.tgz", - "integrity": "sha512-SHetuSLvJDzuNbOdtPVbq6yMMMlLoW5Q94uDqJZqy50gcmAjxFkVqmzqSGEFq9gT2iMuIeKV1PXVWmvUhuZLlQ==", "license": "MIT", "dependencies": { "@emotion/memoize": "^0.9.0" @@ -414,8 +419,6 @@ }, "node_modules/@emotion/is-prop-valid/node_modules/@emotion/memoize": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", "license": "MIT" }, "node_modules/@emotion/memoize": { @@ -424,8 +427,6 @@ }, "node_modules/@emotion/react": { "version": "11.13.0", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.13.0.tgz", - "integrity": "sha512-WkL+bw1REC2VNV1goQyfxjx1GYJkcc23CRQkXX+vZNLINyfI7o+uUn/rTGPt/xJ3bJHd5GcljgnxHf4wRw5VWQ==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", @@ -448,8 +449,6 @@ }, "node_modules/@emotion/react/node_modules/@emotion/cache": { "version": "11.13.1", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.13.1.tgz", - "integrity": "sha512-iqouYkuEblRcXmylXIwwOodiEK5Ifl7JcX7o6V4jI3iW4mLXX3dmt5xwBtIkJiQEXFAI+pC8X0i67yiPkH9Ucw==", "license": "MIT", "dependencies": { "@emotion/memoize": "^0.9.0", @@ -459,16 +458,8 @@ "stylis": "4.2.0" } }, - "node_modules/@emotion/react/node_modules/@emotion/memoize": { + "node_modules/@emotion/react/node_modules/@emotion/cache/node_modules/@emotion/memoize": { "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", - "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "license": "MIT" - }, - "node_modules/@emotion/react/node_modules/@emotion/weak-memoize": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", - "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", "license": "MIT" }, "node_modules/@emotion/serialize": { @@ -492,8 +483,6 @@ }, "node_modules/@emotion/styled": { "version": "11.13.0", - "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.13.0.tgz", - "integrity": "sha512-tkzkY7nQhW/zC4hztlwucpT8QEZ6eUzpXDRhww/Eej4tFfO0FxQYWRyg/c5CCXa4d/f174kqeXYjuQRnhzf6dA==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", @@ -529,13 +518,13 @@ "license": "MIT" }, "node_modules/@emotion/weak-memoize": { - "version": "0.3.1", + "version": "0.4.0", "license": "MIT" }, - "node_modules/@esbuild/darwin-arm64": { + "node_modules/@esbuild/darwin-x64": { "version": "0.21.5", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "MIT", @@ -1167,8 +1156,6 @@ }, "node_modules/@fortawesome/fontawesome-common-types": { "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.6.0.tgz", - "integrity": "sha512-xyX0X9mc0kyz9plIyryrRbl7ngsA9jz77mCZJsUkLl+ZKs0KWObgaEBoSgQiYWAsSmjz/yjl0F++Got0Mdp4Rw==", "license": "MIT", "engines": { "node": ">=6" @@ -1176,8 +1163,6 @@ }, "node_modules/@fortawesome/fontawesome-svg-core": { "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.6.0.tgz", - "integrity": "sha512-KHwPkCk6oRT4HADE7smhfsKudt9N/9lm6EJ5BVg0tD1yPA5hht837fB87F8pn15D8JfTqQOjhKTktwmLMiD7Kg==", "license": "MIT", "peer": true, "dependencies": { @@ -1189,8 +1174,6 @@ }, "node_modules/@fortawesome/free-solid-svg-icons": { "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.6.0.tgz", - "integrity": "sha512-IYv/2skhEDFc2WGUcqvFJkeK39Q+HyPf5GHUrT/l2pKbtgEIv1al1TKd6qStR5OIwQdN1GZP54ci3y4mroJWjA==", "license": "(CC-BY-4.0 AND MIT)", "dependencies": { "@fortawesome/fontawesome-common-types": "6.6.0" @@ -1201,8 +1184,6 @@ }, "node_modules/@fortawesome/react-fontawesome": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.2.2.tgz", - "integrity": "sha512-EnkrprPNqI6SXJl//m29hpaNzOp1bruISWaOiRtkMi/xSvHJlzc2j2JAYS7egxt/EbjSNV/k6Xy0AQI6vB2+1g==", "license": "MIT", "dependencies": { "prop-types": "^15.8.1" @@ -1310,41 +1291,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@isaacs/cliui/node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@isaacs/cliui/node_modules/string-width/node_modules/emoji-regex": { "version": "9.2.2", "dev": true, @@ -1364,28 +1310,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/@isaacs/cliui/node_modules/strip-ansi/node_modules/ansi-regex": { "version": "6.0.1", "dev": true, @@ -1397,57 +1321,6 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { - "version": "6.0.1", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "license": "MIT", @@ -1497,7 +1370,8 @@ }, "node_modules/@mui/icons-material": { "version": "5.16.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.16.7.tgz", + "integrity": "sha512-UrGwDJCXEszbDI7yV047BYU5A28eGJ79keTCP4cc74WyncuVrnurlmIRxaHL8YK+LI1Kzq+/JM52IAkNnv4u+Q==", "dependencies": { "@babel/runtime": "^7.23.9" }, @@ -1563,6 +1437,11 @@ } } }, + "node_modules/@mui/material/node_modules/react-is": { + "version": "18.3.1", + "license": "MIT", + "peer": true + }, "node_modules/@mui/private-theming": { "version": "5.16.6", "license": "MIT", @@ -1701,6 +1580,11 @@ } } }, + "node_modules/@mui/utils/node_modules/react-is": { + "version": "18.3.1", + "license": "MIT", + "peer": true + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "dev": true, @@ -1826,10 +1710,10 @@ "node": ">=14.0.0" } }, - "node_modules/@rollup/rollup-darwin-arm64": { + "node_modules/@rollup/rollup-darwin-x64": { "version": "4.20.0", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "MIT", @@ -1875,10 +1759,10 @@ } } }, - "node_modules/@swc/core-darwin-arm64": { + "node_modules/@swc/core-darwin-x64": { "version": "1.7.11", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "Apache-2.0 AND MIT", @@ -1895,6 +1779,16 @@ "dev": true, "license": "Apache-2.0" }, + "node_modules/@swc/helpers": { + "version": "0.5.12", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@swc/types": { "version": "0.1.12", "dev": true, @@ -1945,8 +1839,6 @@ }, "node_modules/@types/react-fontawesome": { "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@types/react-fontawesome/-/react-fontawesome-1.6.8.tgz", - "integrity": "sha512-+dQ+4jccHraCd/FI4uSeY/O7c1RZ+wVASTgpCgbC6ijh1zSDsr0cb9XU3Dbfy5eJPyXq5QPp9W9RJTVRf+5+pA==", "dev": true, "license": "MIT", "dependencies": { @@ -2100,8 +1992,9 @@ }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -2172,7 +2065,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@vis.gl/react-google-maps/-/react-google-maps-1.1.0.tgz", "integrity": "sha512-MxDIhCfPRzTQY1c6sS0GFg8Ukl40o13fkIKEaCN0cR1BIrV4LPo+EuCov9WElbe0bOo8MApx5qAbqBKOmLQyKg==", - "license": "MIT", "dependencies": { "@types/google.maps": "^3.54.10", "fast-deep-equal": "^3.1.3" @@ -2756,11 +2648,6 @@ "dev": true, "license": "ISC" }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "dev": true, - "license": "MIT" - }, "node_modules/error-ex": { "version": "1.3.2", "license": "MIT", @@ -3354,10 +3241,6 @@ "react-is": "^16.7.0" } }, - "node_modules/hoist-non-react-statics/node_modules/react-is": { - "version": "16.13.1", - "license": "MIT" - }, "node_modules/http-parser-js": { "version": "0.5.8", "license": "MIT" @@ -4088,10 +3971,6 @@ "react-is": "^16.13.1" } }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "license": "MIT" - }, "node_modules/protobufjs": { "version": "7.3.2", "hasInstallScript": true, @@ -4174,9 +4053,8 @@ } }, "node_modules/react-is": { - "version": "18.3.1", - "license": "MIT", - "peer": true + "version": "16.13.1", + "license": "MIT" }, "node_modules/react-router": { "version": "6.26.0", @@ -4431,6 +4309,25 @@ "version": "3.7.0", "license": "MIT" }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, "node_modules/strip-ansi": { "version": "6.0.1", "license": "MIT", @@ -4441,6 +4338,18 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "dev": true, @@ -4845,6 +4754,41 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", "dev": true, diff --git a/frontend/src/components/compound/DirectoryMap/DirectoryMap.tsx b/frontend/src/components/compound/DirectoryMap/DirectoryMap.tsx new file mode 100644 index 0000000..8c93358 --- /dev/null +++ b/frontend/src/components/compound/DirectoryMap/DirectoryMap.tsx @@ -0,0 +1,24 @@ +import { APIProvider, Map, MapCameraChangedEvent } from '@vis.gl/react-google-maps'; + +export default function DirectoryMap() { + const apiKey = import.meta.env.VITE_REACT_APP_GOOGLE_MAPS_API_KEY; + + if (!apiKey) { + console.error('Google Maps API key is not set in the environment variables.'); + return null; + } + + return ( +