mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-09 09:24:30 +01:00
refactor: migrate to jwt sessions instead of store sessions
This commit is contained in:
14
src/App.tsx
14
src/App.tsx
@@ -9,6 +9,7 @@ import LoadingPage from "./Components/LoadingPage/LoadingPage";
|
||||
import { useMeQuery } from "./graphql";
|
||||
import { setUser } from "./redux/features/user.slice";
|
||||
import ProtectedRoute from "./Components/ProtectedRoute/ProtectedRoute";
|
||||
import { Helmet } from "react-helmet";
|
||||
|
||||
// Pages
|
||||
const FeedPage = React.lazy(() => import("./features/Posts/pages/FeedPage/FeedPage"))
|
||||
@@ -62,6 +63,19 @@ function App() {
|
||||
|
||||
|
||||
return <div id="app" className='w-full'>
|
||||
<Helmet>
|
||||
<title >makers.bolt.fun</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="A lightning app directory made for and by the bitcoin community."
|
||||
|
||||
/>
|
||||
<meta
|
||||
property="og:title"
|
||||
content="makers.bolt.fun"
|
||||
|
||||
/>
|
||||
</Helmet>
|
||||
<Navbar />
|
||||
<Suspense fallback={<LoadingPage />}>
|
||||
<Routes>
|
||||
|
||||
@@ -57,7 +57,18 @@ export default function LoginPage() {
|
||||
}, [])
|
||||
|
||||
const startPolling = () => {
|
||||
meQuery.startPolling(3000)
|
||||
// meQuery.startPolling(3000)
|
||||
const interval = setInterval(() => {
|
||||
fetch(CONSTS.apiEndpoint + '/is-logged-in', {
|
||||
credentials: 'include'
|
||||
}).then(data => data.json())
|
||||
.then(data => {
|
||||
if (data.logged_in) {
|
||||
clearInterval(interval)
|
||||
meQuery.refetch();
|
||||
}
|
||||
})
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user