Skip to content

Express Sesssion Middleware with Typescript Build Error #396

Open
@daedalus-hephaestus

Description

@daedalus-hephaestus

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>;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions