Moved things around
Some checks failed
Gitea Actions Demo / build-and-push (push) Failing after 6s

This commit is contained in:
2026-01-21 17:18:58 -05:00
parent a47df7171c
commit a0a059472b
160 changed files with 100 additions and 17 deletions

View File

@@ -0,0 +1,40 @@
import { ref } from 'vue'
export const isParentAuthenticated = ref(false)
export const isUserLoggedIn = ref(false)
export const isAuthReady = ref(false)
export const currentUserId = ref('')
export function authenticateParent() {
isParentAuthenticated.value = true
}
export function logoutParent() {
isParentAuthenticated.value = false
}
export function loginUser() {
isUserLoggedIn.value = true
}
export function logoutUser() {
isUserLoggedIn.value = false
}
export async function checkAuth() {
try {
const res = await fetch('/api/me', { method: 'GET' })
if (res.ok) {
const data = await res.json()
currentUserId.value = data.id
isUserLoggedIn.value = true
} else {
isUserLoggedIn.value = false
currentUserId.value = ''
}
} catch {
isUserLoggedIn.value = false
currentUserId.value = ''
}
isAuthReady.value = true
}