diff --git a/types/passport/passport-tests.ts b/types/passport/passport-tests.ts index 3e7f4e675b..cfee5c914f 100644 --- a/types/passport/passport-tests.ts +++ b/types/passport/passport-tests.ts @@ -138,13 +138,15 @@ passportInstance.use(new TestStrategy()); const authenticator = new passport.Authenticator(); authenticator.use(new TestStrategy()); -declare namespace Express { - interface User { - username: string; - } +declare global { + namespace Express { + interface User { + username: string; + } + } } app.use((req, res, next) => { - console.log(req.user.username); + req.user.username = "hello user"; next(); });