socket.io-website icon indicating copy to clipboard operation
socket.io-website copied to clipboard

Express Sesssion Middleware with Typescript Build Error

Open daedalus-hephaestus opened this issue 2 years ago • 0 comments

Following this tutorial leads to a compilation error.

A user named Goldjee wrote a fix and posted it in a comment.

All you need to do is change:

declare module "http" {
    interface IncomingMessage {
        session: Session & {
            authenticated: boolean
        }
    }
}

to

declare module 'http' {
    interface IncomingMessage {
        cookieHolder?: string;
        session: Session & Partial<session.SessionData>;
    }
}

daedalus-hephaestus avatar Jul 08 '23 23:07 daedalus-hephaestus