mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #24571 from nickp10/master
Add missing jwt function on the express response object for the jwt-express package
This commit is contained in:
Vendored
+11
@@ -218,5 +218,16 @@ declare global {
|
||||
interface Request {
|
||||
jwt: JWT;
|
||||
}
|
||||
|
||||
interface Response {
|
||||
/**
|
||||
* Returns a newly created / signed JWT Object from the payload. If you are using cookies,
|
||||
* it will automatically store the JWT in the cookie as well.
|
||||
*
|
||||
* @param payload The payload of the JWT
|
||||
* @return The newly created JWT
|
||||
*/
|
||||
jwt(payload: any): JWT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ app.use((err: jwt.JWTExpressError, req: exp.Request, res: exp.Response, next: ex
|
||||
jwtObj = req.jwt;
|
||||
req.jwt.payload;
|
||||
req.hostname.startsWith("");
|
||||
jwtObj = res.jwt({ });
|
||||
});
|
||||
|
||||
jwtObj.expired.valueOf();
|
||||
@@ -60,4 +61,5 @@ app.get("", (req: exp.Request, res: exp.Response, next: exp.NextFunction) => {
|
||||
jwtObj = req.jwt;
|
||||
req.jwt.payload;
|
||||
req.hostname.startsWith("");
|
||||
jwtObj = res.jwt({ });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user