Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 3b4240e

Browse files
author
Ian Walter
committed
InvalidCsrfTokenError -> InvalidCsrfError
1 parent 71c062a commit 3b4240e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const BaseError = require('@ianwalter/base-error')
44
const ignoredMethods = ['GET', 'HEAD', 'OPTIONS']
55
const tokens = new Tokens()
66

7-
class InvalidCsrfTokenError extends BaseError {
7+
class InvalidCsrfError extends BaseError {
88
constructor (token) {
99
super(`Invalid CSRF token ${token}`)
1010
}
@@ -53,10 +53,10 @@ function csrfValidation (req, res, next) {
5353
next()
5454
} else {
5555
// If the CSRF token contained in the request header doesn't match the CSRF
56-
// secret stored in the session, pass the InvalidCsrfTokenError to the next
56+
// secret stored in the session, pass the InvalidCsrfError to the next
5757
// error-handling middleware.
58-
next(new InvalidCsrfTokenError(token))
58+
next(new InvalidCsrfError(token))
5959
}
6060
}
6161

62-
module.exports = { csrfGeneration, csrfValidation, InvalidCsrfTokenError }
62+
module.exports = { csrfGeneration, csrfValidation, InvalidCsrfError }

0 commit comments

Comments
 (0)