From 34e8ecec70c8b7e9cd357373978ddc5854c0d418 Mon Sep 17 00:00:00 2001 From: "youssef.el-mkhantar" Date: Fri, 12 Jul 2024 17:41:02 +0200 Subject: [PATCH] =?UTF-8?q?fix(pencil):=20fix=20du=20jwt=20sur=20le=20lien?= =?UTF-8?q?=20mod=C3=A9rateur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 10 +++++++--- src/pages/Jitsi_meet/Jitsi_meet.tsx | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 9fa0e6e..29578fd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,7 +42,7 @@ interface JwtPayload { function App() { const [roomName, setRoomName] = useState(''); - const [jwt, setJwt] = useState(''); + const [jwt, setJwt] = useState(null); const [hide, setHide] = useState(false); const [error, setError] = useState({ message: "la page que vous demandez n'existe pas", @@ -170,12 +170,15 @@ function App() { }) .then((res: any) => { if (res.data.jwt) { - navigate(`/${res.data.roomName}?jwt=${res.data.jwt}`, { + setJwt(res.data.jwt); + console.log('--------------------', res.data.jwt); + return navigate(`/${res.data.roomName}`, { replace: true, }); - return window.location.reload(); + // return window.location.reload(); } else { if (!res.data.error && !res.data.login) { + setJwt(null); return navigate(`/${roomName}`); } else { if (res.data.login) { @@ -231,6 +234,7 @@ function App() { setError={setError} setMsg={setMsg} setRoomName={setRoomName} + jwt={jwt} /> ); } diff --git a/src/pages/Jitsi_meet/Jitsi_meet.tsx b/src/pages/Jitsi_meet/Jitsi_meet.tsx index 2f64b4f..6d397ee 100644 --- a/src/pages/Jitsi_meet/Jitsi_meet.tsx +++ b/src/pages/Jitsi_meet/Jitsi_meet.tsx @@ -20,6 +20,7 @@ interface JitsiMeetProps { joinConference: (e: string) => void; setMsg: (e: ReactNode) => void; setRoomName: (e: string) => void; + jwt: any; } const Jitsi_meet = ({ @@ -27,10 +28,11 @@ const Jitsi_meet = ({ joinConference, setMsg, setRoomName, + jwt, }: JitsiMeetProps) => { const navigate = useNavigate(); const { roomName } = useParams(); - const jwt = window.location.search.split('=')[1]; + // const jwt = window.location.search.split('=')[1]; const handleJitsiIFrameRef1 = (iframeRef: any) => { iframeRef.style.border = '10px solid #3d3d3d';