Skip to content

Commit 13a035a

Browse files
author
Your Name
committed
angular security course
1 parent e0529aa commit 13a035a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

csrf/csrf-page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ <h1>GOTCHA!!!</h1>
1515

1616
<script>
1717

18+
document.cookie = 'XSRF-TOKEN=12233';
1819

1920
setTimeout(function() {
2021
document.getElementById("csrf-form").submit();

server/csrf.middleware.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export function checkCsrfToken(req: Request, res: Response, next: NextFunction
1111

1212
const csrfHeader = req.headers['x-xsrf-token'];
1313

14-
const sessionToken = req.cookies["SESSIONID"];
15-
1614
if (csrfCookie && csrfHeader && csrfCookie === csrfHeader) {
1715
next();
1816
}

0 commit comments

Comments
 (0)