implemented individual list functionality

This commit is contained in:
Edward Tirado Jr 2026-02-25 17:33:37 -06:00
parent 3373380f34
commit c5f74f134d
24 changed files with 592 additions and 109 deletions

View file

@ -1,6 +1,5 @@
export const useAuth = () => {
const config = useRuntimeConfig()
const router = useRouter()
const login = async (email: string, password: string) => {
await $fetch('/sanctum/csrf-cookie', {
@ -8,12 +7,12 @@ export const useAuth = () => {
credentials: 'include',
})
await $api('/api/login', {method: 'POST', body: {email, password}})
await router.push('/')
await navigateTo('/')
}
const logout = async () => {
await $api('/api/logout', {method: 'POST'})
await router.push('/')
await navigateTo('/auth/login')
}
return {login, logout}