update ui and other frontend updates
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import PocketBase from 'pocketbase';
|
||||
import { SERVER_IP, PB_PORT } from '$app/env/public';
|
||||
import { PUBLIC_PB_URL } from '$app/env/public';
|
||||
|
||||
const url = `http://${SERVER_IP}:${PB_PORT}`;
|
||||
export const pb: PocketBase = new PocketBase(url);
|
||||
export const pb = new PocketBase(PUBLIC_PB_URL);
|
||||
pb.autoCancellation(false);
|
||||
|
||||
export function initPbFromCookie() {
|
||||
const match = document.cookie.match(/(?:^|;\s*)pb_token=([^;]*)/);
|
||||
if (match) {
|
||||
pb.authStore.save(match[1], null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user