проверка наличия токена в адресной строке

This commit is contained in:
Tamara 2024-03-07 01:29:10 +03:00
parent 55c1a75d9f
commit d20a5d6435

@ -1,4 +1,4 @@
import React from "react";
import React, {useEffect} from "react";
import { CssBaseline, useMediaQuery, useTheme } from "@mui/material";
import Header from "./HeaderLanding";
import Footer from "./FooterLanding";
@ -14,10 +14,18 @@ import StartWithTemplates from "./StartWithTemplates";
import WhatTheFeatures from "./WhatTheFeatures";
import FullScreenDialog from "./headerMobileLanding";
import Collaboration from "./Collaboration";
import { setAuthToken } from "@frontend/kitui";
export default function Landing() {
const theme = useTheme();
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
useEffect(() => {
const currentUrl = window.location.search.split('=')[1]
if (currentUrl !== "") {
setAuthToken(currentUrl)
history.pushState(null, document.title, "/")
}
},[])
return (
<>