From ecc6a55aba7bb35fc778e7a53848396b88214151 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sat, 23 Aug 2025 22:29:28 +0100 Subject: Add multiple conferences feature --- web/stores/auth.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 web/stores/auth.ts (limited to 'web/stores/auth.ts') 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} +}) -- cgit v1.2.3-70-g09d2