Skip to content

Commit

Permalink
Delete check jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktoriia committed Oct 19, 2023
1 parent 50e83fd commit 0f874c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 46 deletions.
28 changes: 0 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 3 additions & 17 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 (
<div>
{token ? (
<div className="tldraw">
<Info />
<Editor roomId={roomID} />
</div>
) : null}
<div className="tldraw">
<Info />
<Editor roomId={roomID} />
</div>
);
}

0 comments on commit 0f874c4

Please sign in to comment.