fix: session auth issues

This commit is contained in:
swve 2024-05-27 20:58:32 +02:00
parent 1708b36818
commit 08cc97f557
70 changed files with 607 additions and 427 deletions

View file

@ -2,16 +2,19 @@ import { getAPIUrl } from '@services/config/config'
import { updateInstall } from '@services/install/install'
import { swrFetcher } from '@services/utils/ts/requests'
import { Check } from 'lucide-react'
import { useLHSession } from '@components/Contexts/LHSessionContext'
import { useRouter } from 'next/navigation'
import React from 'react'
import useSWR from 'swr'
const Finish = () => {
const session = useLHSession() as any;
const access_token = session?.data?.tokens?.access_token;
const {
data: install,
error: error,
isLoading,
} = useSWR(`${getAPIUrl()}install/latest`, swrFetcher)
} = useSWR(`${getAPIUrl()}install/latest`, (url) => swrFetcher(url, access_token))
const router = useRouter()
async function finishInstall() {