diff --git a/server/api/auth/session.get.ts b/server/api/auth/session.get.ts index f6f45ad..337b303 100644 --- a/server/api/auth/session.get.ts +++ b/server/api/auth/session.get.ts @@ -1,7 +1,14 @@ +import jwt from "jsonwebtoken"; +import { log } from "~/lib/server/logger"; export default eventHandler((event) => { + let ahead = ( + getHeaders(event).authorization || + getCookie(event, "auth:token") || + "" + )?.replace("Bearer ", ""); if (event.context.currentUser) { return { - token: getHeader(event, "Authorization"), + token: ahead, user: event.context.currentUser, }; } else {