Skip to content

Commit

Permalink
chore: update getSessionIdentifier tests with 3.0.4..3.0.7 rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
psibean committed Sep 21, 2024
1 parent 1941dea commit 2bfb4a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/tests/getSessionIdentifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ describe("csrf-csrf with getSessionIdentifier", () => {

assert.isFalse(validateRequest(mockRequest));
expect(() =>
generateToken(mockRequest, mockResponse, false, true),
generateToken(mockRequest, mockResponse, {
overwrite: false,
validateOnReuse: true,
}),
).to.throw(invalidCsrfTokenError);
});

Expand All @@ -85,7 +88,9 @@ describe("csrf-csrf with getSessionIdentifier", () => {

(mockRequest as RequestWithSessionId).session.id = "sdf9342dfa245r13tgvrf";
console.log("generating a new token");
const newCsrfToken = generateToken(mockRequest, mockResponse, true);
const newCsrfToken = generateToken(mockRequest, mockResponse, {
overwrite: true,
});
console.log("new token generated");
assert.notEqual(
newCsrfToken,
Expand Down
2 changes: 0 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,3 @@ export interface DoubleCsrfUtilities {
*/
doubleCsrfProtection: doubleCsrfProtection;
}

export {};

0 comments on commit 2bfb4a6

Please sign in to comment.