aboutsummaryrefslogtreecommitdiffstats
path: root/web/stores/auth.ts
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-08-23 22:29:28 +0100
committerLeonardo Bishop <me@leonardobishop.com>2025-08-23 22:29:28 +0100
commitecc6a55aba7bb35fc778e7a53848396b88214151 (patch)
tree1b37a2dc5f4594155114da1ae0c4529d20a4c548 /web/stores/auth.ts
parent8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (diff)
Add multiple conferences feature
Diffstat (limited to 'web/stores/auth.ts')
-rw-r--r--web/stores/auth.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/stores/auth.ts b/web/stores/auth.ts
new file mode 100644
index 0000000..71ba5c0
--- /dev/null
+++ b/web/stores/auth.ts
@@ -0,0 +1,12 @@
+import { useLocalStorage } from "@vueuse/core";
+import { defineStore } from "pinia";
+
+export const useAuthStore = defineStore('auth', () => {
+ const token = useLocalStorage('auth/token', null)
+ const username = useLocalStorage('auth/username', null)
+ const admin = useLocalStorage('auth/admin', false)
+
+ const isLoggedIn = () => token.value != null
+
+ return {token, username, admin, isLoggedIn}
+})