Skip to content

Commit

Permalink
Fixing Huge Auth Safety Issue
Browse files Browse the repository at this point in the history
Signed-off-by: Type-32 <[email protected]>
  • Loading branch information
Type-32 committed Jul 15, 2024
1 parent 5793bf0 commit b9b10c9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/middleware/check-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 2 additions & 0 deletions prisma/migrations/20240714144519_init11/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Media" ALTER COLUMN "pseudoDirectory" SET DEFAULT '/';
2 changes: 1 addition & 1 deletion prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ model Media {
fileName String
url String
directory String
pseudoDirectory String @default("/media")
pseudoDirectory String @default("/")
isFolder Boolean @default(false)
}

Expand Down

0 comments on commit b9b10c9

Please sign in to comment.