implemented individual list functionality
This commit is contained in:
parent
3373380f34
commit
c5f74f134d
24 changed files with 592 additions and 109 deletions
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue