diff --git a/app/middleware/check-auth.ts b/app/middleware/check-auth.ts index 14e099f..0892f14 100644 --- a/app/middleware/check-auth.ts +++ b/app/middleware/check-auth.ts @@ -6,7 +6,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => { // console.log(auth.isAuthenticated) await auth.validateToken() - if (!auth.isAuthenticated || useCookie('session_token').value == null || useCookie('session_token') === undefined) { + if (!auth.isAuthenticated.value || useCookie('session_token').value == null || useCookie('session_token') === undefined) { // console.log('No good, no cookie') return navigateTo('/auth'); } diff --git a/prisma/migrations/20240714144519_init11/migration.sql b/prisma/migrations/20240714144519_init11/migration.sql new file mode 100644 index 0000000..3c282fd --- /dev/null +++ b/prisma/migrations/20240714144519_init11/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "Media" ALTER COLUMN "pseudoDirectory" SET DEFAULT '/'; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index ba19219..ef17db5 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -63,7 +63,7 @@ model Media { fileName String url String directory String - pseudoDirectory String @default("/media") + pseudoDirectory String @default("/") isFolder Boolean @default(false) }