You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.
I had arranged a middleware to allow a certain route to pass without csrf examine like the below. Now, I've been trying to get rid of this error message: [TypeError: Object #<incomingMessage> has no method 'csrfToken'] . Because of this error my response status is set as 500 (internal server error).
I was wondering how can I obstruct being called csrfToken() ?
var csrf = csurf()
app.use(function (req, res, next) {
if (req.path == '/test') return next()
csrf(req, res, next)
})
The text was updated successfully, but these errors were encountered:
Hi! That method is never called by this module, rather it is called by your own code. If you can print out the stack trace for that error, it will point to the line number and which one of your files is calling it.
Oh my bad!
I didn't know but I learned how to print out stack trace.
And I had forgotten that I called the method in another middleware.
And I've taken your time two times.
I'm sorry and thank you!
Hello,
I had arranged a middleware to allow a certain route to pass without csrf examine like the below. Now, I've been trying to get rid of this error message:
[TypeError: Object #<incomingMessage> has no method 'csrfToken']
. Because of this error my response status is set as 500 (internal server error).I was wondering how can I obstruct being called csrfToken() ?
The text was updated successfully, but these errors were encountered: