changes
This commit is contained in:
parent
e3f2e33b90
commit
1c3685199b
@ -1,7 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { SvelteToast } from "@zerodevx/svelte-toast";
|
import { SvelteToast } from "@zerodevx/svelte-toast";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import "../app.css";
|
import "../../app.css";
|
||||||
import Navbar from "$lib/ui-components/navbar.svelte";
|
import Navbar from "$lib/ui-components/navbar.svelte";
|
||||||
import { checkAuth, checkAuthSync } from "$lib/auth/Auth";
|
import { checkAuth, checkAuthSync } from "$lib/auth/Auth";
|
||||||
import { redirect } from "$lib/tools/url/URLTools";
|
import { redirect } from "$lib/tools/url/URLTools";
|
||||||
@ -10,32 +10,31 @@
|
|||||||
let loggedIn = false;
|
let loggedIn = false;
|
||||||
let authCheckInProgress = false;
|
let authCheckInProgress = false;
|
||||||
|
|
||||||
|
AuthStorage.subscribe((s) => {
|
||||||
AuthStorage.subscribe((s)=>{
|
|
||||||
loggedIn = s.logged;
|
loggedIn = s.logged;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
if (
|
||||||
if (!checkAuthSync() && !window.location.pathname.toLocaleLowerCase().includes("/login")) {
|
!checkAuthSync() &&
|
||||||
|
!window.location.pathname.toLocaleLowerCase().includes("/login")
|
||||||
|
) {
|
||||||
redirect("/admin/login");
|
redirect("/admin/login");
|
||||||
}
|
} else if (checkAuthSync()) {
|
||||||
else if (checkAuthSync())
|
|
||||||
{
|
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if loggedIn}
|
{#if loggedIn}
|
||||||
<div class="fixed left-0 right-0 top-0 flex z-10">
|
<div class="fixed left-0 right-0 top-0 flex z-10">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<div class="flex justify-center flex-shrink-0 w-full h-[calc(100vh-52px-68px)] mt-[68px] overflow-auto p-4">
|
<div
|
||||||
|
class="flex justify-center flex-shrink-0 w-full h-[calc(100vh-52px-68px)] mt-[68px] overflow-auto p-4"
|
||||||
|
>
|
||||||
<div class="flex w-full md:max-w-[90%] lg:max-w-[1080px]">
|
<div class="flex w-full md:max-w-[90%] lg:max-w-[1080px]">
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
@ -20,21 +20,21 @@ const config = {
|
|||||||
prerender: {
|
prerender: {
|
||||||
// default: true,
|
// default: true,
|
||||||
entries: [
|
entries: [
|
||||||
"/user/change/sampleToken",
|
"/admin/user/change/sampleToken",
|
||||||
"/user/edit/req/sampleToken/sampleReqID",
|
"/admin/user/edit/req/sampleToken/sampleReqID",
|
||||||
"/user/neworder/sampleToken",
|
"/admin/user/neworder/sampleToken",
|
||||||
"/user/profile/sampleToken",
|
"/admin/user/profile/sampleToken",
|
||||||
"/",
|
"/admin/",
|
||||||
"/login",
|
"/admin/login",
|
||||||
"/newuser",
|
"/admin/newuser",
|
||||||
"/userslist",
|
"/admin/userslist",
|
||||||
"/disputes",
|
"/admin/disputes",
|
||||||
"/payouts",
|
"/admin/payouts",
|
||||||
"/merchants",
|
"/admin/merchants",
|
||||||
"/orders",
|
"/admin/orders",
|
||||||
"/currencies",
|
"/admin/currencies",
|
||||||
"/sms",
|
"/admin/sms",
|
||||||
"/withdrawals"
|
"/admin/withdrawals"
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user