-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_csrf
view local is not defined inside of partials when using CSRF protection
#3707
Comments
@selenir Thanks for the report. I took a quick look around and I think this is due to an inconsistency coming from an old dependency: ejs-locals. It's about time to dig into that layout/partials stuff for some updates anyways, and right now I'm also in the process of working on a friendlier "bootstrap-data-for-access-from-client-side-js" helper, so the timing is right to go ahead and figure this out once and for all (and probably fix it there, then fold that code into the core views hook). If you have a moment, would you make a quick GitHub repo that reproduces this in the simplest possible app using v0.12.x of Sails? That'll save me some time while debugging, and also rule out any version-specific issues (If it turns out this has already been fixed in 0.12, it's no problem to backport a fix as a patch release for 0.11.x-- and I'd rather know that now before I go in there and fold in the dependency). Thanks! |
_csrf
view local is not defined inside of partials when using CSRF protection
I think I'm not able to reproduce this bug. In 99% cases it works fine. The call stack is from home page of my Sails app, which is rendered ~10k times per day and the bug showed only few times. I will try to log more data on this route, maybe something will show up. |
Yeah, that's...really weird. It'd be worth hiding a |
I'm encountering this too; it might be related to #2566. |
@selenir thanks for the additional info! Keep us posted if you're able to reproduce this-- I'll leave the issue open. @not-an-aardvark Hmm, are you seeing it only w/ partials as well? If not, it seems less likely that it's |
Nope, the place where I was having an issue wasn't in a partial, it was in the main Unfortunately, I don't have a reproducible test-case for it. I only noticed the issue in porybox/porybox@b12aa8c because I saw errors in the server logs about Thanks for looking into this! |
I created another case (#3865), but after reading this case, I think it may be connected. This error occurs when you request HEAD for page. |
See answer in #3865, since it might explain the intermittent issue seen in this post. |
Ok, since there's been no further chatter on this I'm assuming it's related to #3865. |
Sails version: 0.11.4
Node version: 5.4.1
NPM version: 3.5.2
Operating system: Ubuntu 14.04
Unfortunately the only thing I have is this call stack:
It's the first time I see this error. It has never shown up during development. Maybe it's related to partial, since this is the only time I'm using partials in my view. Of course I have CSRF protection enabled in config.
The text was updated successfully, but these errors were encountered: