mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-25 17:24:23 +01:00
update: use fluentApi to fetch images in resolvers
This commit is contained in:
@@ -14,13 +14,7 @@ import { fetchIsLoggedIn, fetchLnurlAuth } from "src/api/auth";
|
||||
|
||||
|
||||
|
||||
const fetchLnurlAuth = async () => {
|
||||
const res = await fetch(CONSTS.apiEndpoint + '/get-login-url', {
|
||||
credentials: 'include'
|
||||
})
|
||||
const data = await res.json()
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
export const useLnurlQuery = () => {
|
||||
const [loading, setLoading] = useState(true)
|
||||
@@ -101,15 +95,9 @@ export default function LoginPage() {
|
||||
if (canFetchIsLogged.current === false) return;
|
||||
|
||||
canFetchIsLogged.current = false;
|
||||
fetch(CONSTS.apiEndpoint + '/is-logged-in', {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
session_token
|
||||
}
|
||||
})
|
||||
.then(data => data.json())
|
||||
.then(data => {
|
||||
if (data.logged_in) {
|
||||
fetchIsLoggedIn(session_token)
|
||||
.then(is_logged_in => {
|
||||
if (is_logged_in) {
|
||||
clearInterval(interval)
|
||||
refetch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user