feat: 1-to-1 message render + web data-lake backend

This commit is contained in:
h
2026-05-31 01:27:40 +02:00
parent f0afb7ec5b
commit 75425d1bee
110 changed files with 10199 additions and 54 deletions
+37
View File
@@ -0,0 +1,37 @@
import { browser } from "$app/environment";
const STORAGE_KEY = "bg.token";
function readToken(): string | null {
if (!browser) {
return null;
}
return localStorage.getItem(STORAGE_KEY);
}
function createAuth() {
let token = $state<string | null>(readToken());
return {
get token() {
return token;
},
get isAuthenticated() {
return token !== null && token.length > 0;
},
login(value: string) {
token = value;
if (browser) {
localStorage.setItem(STORAGE_KEY, value);
}
},
logout() {
token = null;
if (browser) {
localStorage.removeItem(STORAGE_KEY);
}
},
};
}
export const auth = createAuth();