Skip to content

Commit

Permalink
fix(pencil): fix du jwt sur le lien modérateur
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef.el-mkhantar committed Jul 12, 2024
1 parent 92b5480 commit 34e8ece
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<errorObj>({
message: "la page que vous demandez n'existe pas",
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -231,6 +234,7 @@ function App() {
setError={setError}
setMsg={setMsg}
setRoomName={setRoomName}
jwt={jwt}
/>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Jitsi_meet/Jitsi_meet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,19 @@ interface JitsiMeetProps {
joinConference: (e: string) => void;
setMsg: (e: ReactNode) => void;
setRoomName: (e: string) => void;
jwt: any;
}

const Jitsi_meet = ({
setError,
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';
Expand Down

0 comments on commit 34e8ece

Please sign in to comment.