refactor: migrate to jwt sessions instead of store sessions

This commit is contained in:
MTG2000
2022-06-09 12:28:34 +03:00
parent d8fd6e1432
commit 435fc7f844
14 changed files with 257 additions and 234 deletions

View File

@@ -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)
}