diff --git a/package-lock.json b/package-lock.json index 85ddaa4e..53525a37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,6 @@ "mongoose": "^7.0.3", "prettier": "^3.0.0", "react": "^18.2.0", - "react-cookie": "^6.1.1", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "socket.io-client": "^4.7.1", @@ -5750,11 +5749,6 @@ "@types/node": "*" } }, - "node_modules/@types/cookie": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.3.tgz", - "integrity": "sha512-SLg07AS9z1Ab2LU+QxzU8RCmzsja80ywjf/t5oqw+4NSH20gIGlhLOrBDm1L3PBWzPa4+wkgFQVZAjE6Ioj2ug==" - }, "node_modules/@types/eslint": { "version": "8.44.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", @@ -18847,19 +18841,6 @@ "node": ">=14" } }, - "node_modules/react-cookie": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-6.1.1.tgz", - "integrity": "sha512-fuFRpf8LH6SfmVMowDUIRywJF5jAUDUWrm0EI5VdXfTl5bPcJ7B0zWbuYpT0Tvikx7Gs18MlvAT+P+744dUz2g==", - "dependencies": { - "@types/hoist-non-react-statics": "^3.3.1", - "hoist-non-react-statics": "^3.3.2", - "universal-cookie": "^6.0.0" - }, - "peerDependencies": { - "react": ">= 16.3.0" - } - }, "node_modules/react-dev-utils": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", @@ -22767,15 +22748,6 @@ "node": ">=8" } }, - "node_modules/universal-cookie": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-6.1.1.tgz", - "integrity": "sha512-33S9x3CpdUnnjwTNs2Fgc41WGve2tdLtvaK2kPSbZRc5pGpz2vQFbRWMxlATsxNNe/Cy8SzmnmbuBM85jpZPtA==", - "dependencies": { - "@types/cookie": "^0.5.1", - "cookie": "^0.5.0" - } - }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", diff --git a/package.json b/package.json index 2c27fdc9..7bf0e555 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "mongoose": "^7.0.3", "prettier": "^3.0.0", "react": "^18.2.0", - "react-cookie": "^6.1.1", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "socket.io-client": "^4.7.1", diff --git a/src/App.tsx b/src/App.tsx index 810f60e9..1f246c7f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,8 +3,6 @@ import { useUsers } from 'y-presence'; import { useMultiplayerState } from './hooks/useMultiplayerState'; import './App.css'; import { awareness, roomID } from './store/store'; -import { useEffect } from 'react'; -import { useCookies } from 'react-cookie'; function Editor({ roomId }: { roomId: string }) { const { onMount, ...events } = useMultiplayerState(roomId); @@ -33,22 +31,10 @@ function Info() { } export default function App() { - const [cookies] = useCookies(['jwt']); - const token = cookies.jwt; - - useEffect(() => { - if (!token) { - window.location.href = '/login'; - } - }, []); return ( -
- {token ? ( -
- - -
- ) : null} +
+ +
); }