Update passport-tests.ts

This commit is contained in:
Daniel Perez Alvarez
2018-02-15 10:12:29 -05:00
committed by GitHub
parent 259c6434a4
commit 3ef2b4b3b4
+7 -5
View File
@@ -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();
});