This commit is contained in:
Nadar
2026-03-17 13:24:22 +03:00
commit 82e5ac9d81
554 changed files with 29637 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import type { User } from '~/composables/use-auth'
export default defineNuxtRouteMiddleware(async (to, from) => {
const session = useCookie('session')
const { authenticated, user } = useAuth()
if (session.value && !authenticated.value) {
try {
user.value = await $api<User>('/users/current', {
method: 'get',
})
}
catch (e) {
console.log(e)
}
}
})