Since getSession() returns Promise<default | null | undefined> you need to wait for the promise to resolve or reject.
const session = await getSession(req, res)
Since getSession() returns Promise<default | null | undefined> you need to wait for the promise to resolve or reject.
const session = await getSession(req, res)