We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29630c6 commit 5931833Copy full SHA for 5931833
src/routes/+layout.ts
@@ -2,14 +2,13 @@ import type { LayoutLoad } from './$types';
2
import { pb } from '$lib/pocketbase';
3
import type { RecordModel } from 'pocketbase';
4
5
-export const load: LayoutLoad = async ({ setHeaders }) => {
+export const load: LayoutLoad = async () => {
6
pb.authStore.loadFromCookie(document.cookie);
7
8
try {
9
pb.authStore.isValid && (await pb.collection('users').authRefresh());
10
- } catch (e) {
11
- console.log('authRefresh error', e);
12
- // do nothing
+ } catch (_) {
+ pb.authStore.clear();
13
}
14
15
const user = pb.authStore.model;
0 commit comments