expressjs / csurf

CSRF token middleware
MIT License
2.3k stars 217 forks source link

cookie option cannot be bool true or else .key is undefined... #34

Closed busticated closed 9 years ago

busticated commented 9 years ago

docs say:

code says:

if (options.cookie && !options.cookie.key) {
    options.cookie.key = '_csrf'
}

so, if i do the following:

app.use(express.csrf({ cookie: true }));

options.cookie.key is undefined because .key is assigned to a bool.

what am I missing?

dougwilson commented 9 years ago

Sounds like a module bug to me :)

busticated commented 9 years ago

hehe! thought so :-)

want a patch or have you already fixed it? :-D

dougwilson commented 9 years ago

Sorry, didn't even look at this reply until I pushed the fix ;) I'll have it published to npm in just a little bit.

busticated commented 9 years ago

oh no sweat! again, i figured :)

thanks a bunch! :+1:

dougwilson commented 9 years ago

Thank you for the report :) Published as 1.6.2