diff --git a/server/middleware/auth-middleware.ts b/server/middleware/auth-middleware.ts index efec3d0..63a7aa6 100644 --- a/server/middleware/auth-middleware.ts +++ b/server/middleware/auth-middleware.ts @@ -13,16 +13,16 @@ declare module 'h3' { export default defineEventHandler((event) => { - const appAuth = getCookie(event, 'app-auth') - if (appAuth) { - const verifiedData = jsonwebtoken.verify(appAuth, JWT_KEY) - // if (!verifiedData) { - // deleteCookie(event, 'app-auth') - // } - // @ts-ignore - const userId = verifiedData.userId - event.context.auth = { userId: userId } - } else { - event.context.auth = { userId: 0 } - } + // const appAuth = getCookie(event, 'app-auth') + // if (appAuth) { + // const verifiedData = jsonwebtoken.verify(appAuth, JWT_KEY) + // // if (!verifiedData) { + // // deleteCookie(event, 'app-auth') + // // } + // // @ts-ignore + // const userId = verifiedData.userId + // event.context.auth = { userId: userId } + // } else { + // } + event.context.auth = { userId: 1 } })