fixes serverside pb auth
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script>
|
||||
localStorage.theme === 'dark' ||
|
||||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
? document.documentElement.classList.add('dark')
|
||||
: document.documentElement.classList.add('light');
|
||||
</script>
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -7,6 +7,7 @@
|
||||
--content: 0, 0, 0;
|
||||
|
||||
--input-background: 249, 250, 251;
|
||||
--input-background-error: 254, 242, 242;
|
||||
--input-border: 209, 213, 219;
|
||||
--input-border-focus: 36, 39, 52;
|
||||
--input-ring: 148, 163, 184;
|
||||
@@ -32,6 +33,7 @@
|
||||
--content: 255, 255, 255;
|
||||
|
||||
--input-background: 36, 39, 52;
|
||||
--input-background-error: 69, 10, 10;
|
||||
--input-border: 43, 46, 61;
|
||||
--input-border-focus: 108, 115, 150;
|
||||
--input-ring: 108, 115, 150;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { createInstance } from '$lib/pocketbase'
|
||||
import { createInstance, pb } from '$lib/pocketbase'
|
||||
import type { Handle } from '@sveltejs/kit'
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
const pb = createInstance()
|
||||
|
||||
// load the store data from the request cookie string
|
||||
pb.authStore.loadFromCookie(event.request.headers.get('cookie') || '')
|
||||
try {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</script>
|
||||
|
||||
<button
|
||||
class={extraClasses}
|
||||
class="{extraClasses} flex items-center justify-center"
|
||||
class:btn-primary={primary}
|
||||
class:btn-secondary={secondary}
|
||||
class:btn-large={large}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{name}
|
||||
class="bg-input-background border border-input-border rounded-md p-3 transition-colors focus:border-input-border-focus focus:outline-none focus:ring-0 w-full {extraClasses}"
|
||||
class:border-red-400={error.length > 0}
|
||||
class:bg-red-50={error.length > 0}
|
||||
class:bg-input-background-error={error.length > 0}
|
||||
{autocomplete}
|
||||
use:typeAction
|
||||
bind:value
|
||||
|
||||
@@ -6,7 +6,10 @@ type Theme = "dark" | "light"
|
||||
export const theme: Writable<Theme> = writable(browser && localStorage.getItem("theme") as Theme || "light" );
|
||||
|
||||
export function toggleTheme() {
|
||||
const newTheme = get(theme) === "light" ? "dark" : "light";
|
||||
const currentTheme = get(theme);
|
||||
const newTheme = currentTheme === "light" ? "dark" : "light";
|
||||
document.documentElement.classList.remove(currentTheme)
|
||||
document.documentElement.classList.add(newTheme)
|
||||
theme.set(newTheme)
|
||||
localStorage.setItem("theme", newTheme);
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
import Toast from "$lib/components/base/toast.svelte";
|
||||
import Footer from "$lib/components/footer.svelte";
|
||||
import NavBar from "$lib/components/nav_bar.svelte";
|
||||
import { theme } from "$lib/stores/theme_store";
|
||||
import "@fortawesome/fontawesome-free/css/all.min.css";
|
||||
import "../css/app.css";
|
||||
import "../css/components.css";
|
||||
@@ -10,12 +9,10 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title> | wanderer</title>
|
||||
<title>| wanderer</title>
|
||||
</svelte:head>
|
||||
<div class="theme {$theme}">
|
||||
<NavBar></NavBar>
|
||||
<Toast></Toast>
|
||||
<slot />
|
||||
<NavBar></NavBar>
|
||||
<Toast></Toast>
|
||||
<slot />
|
||||
|
||||
<Footer></Footer>
|
||||
</div>
|
||||
<Footer></Footer>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
class="grid grid-cols-1 lg:grid-cols-2 justify-items-center gap-8 py-8"
|
||||
>
|
||||
{#each $categories as category}
|
||||
<a href="/trails?category={category.id}">
|
||||
<a href="/trails?category={category.id}" data-sveltekit-preload-data="off">
|
||||
<CategoryCard {category}></CategoryCard>
|
||||
</a>
|
||||
{/each}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Trail } from "$lib/models/trail";
|
||||
import { categories_index } from "$lib/stores/category_store";
|
||||
import { trail, trails_show } from "$lib/stores/trail_store";
|
||||
import { trails_show } from "$lib/stores/trail_store";
|
||||
import { error, type Load } from "@sveltejs/kit";
|
||||
|
||||
export const load: Load = async ({ params }) => {
|
||||
|
||||
@@ -274,7 +274,7 @@
|
||||
<button
|
||||
class="leaflet-control fa fa-{mapFullScreen
|
||||
? 'minimize'
|
||||
: 'maximize'} rounded-full text-lg bg-white px-[14px] py-2 hover:bg-gray-100"
|
||||
: 'maximize'} rounded-full text-lg bg-white text-black px-[14px] py-2 hover:bg-gray-100"
|
||||
style="cursor: pointer !important"
|
||||
on:click={() => toggleMapFullScreen()}
|
||||
></button>
|
||||
|
||||
@@ -2,9 +2,5 @@ import { trails_show } from "$lib/stores/trail_store";
|
||||
import type { Load } from "@sveltejs/kit";
|
||||
|
||||
export const load: Load = async ({ params }) => {
|
||||
try {
|
||||
await trails_show(params.id!, true)
|
||||
}catch(e) {
|
||||
|
||||
}
|
||||
await trails_show(params.id!, true)
|
||||
};
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 781 KiB After Width: | Height: | Size: 284 KiB |
@@ -12,6 +12,7 @@ export default {
|
||||
'secondary-hover': 'rgba(var(--secondary-hover))',
|
||||
|
||||
'input-background': 'rgba(var(--input-background))',
|
||||
'input-background-error': 'rgba(var(--input-background-error))',
|
||||
'input-border': 'rgba(var(--input-border))',
|
||||
'input-border-focus': 'rgba(var(--input-border-focus))',
|
||||
'input-ring': 'rgba(var(--input-ring))',
|
||||
|
||||
Reference in New Issue
Block a user