-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
BUG Lost session and some other vars in request #4541
Comments
Hi @westtrade! It looks like you missed a step or two when you created your issue. Please edit your comment (use the pencil icon at the top-right corner of the comment box) and fix the following:
As soon as those items are rectified, post a new comment (e.g. “Ok, fixed!”) below and we'll take a look. Thanks! *If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact inquiries@sailsjs.com |
@westtrade Are you getting any specific error messages or no errors during these lost requests? Also, could you provide further detail of what you are wanting to accomplish with this code? Thanks for the code examples, any more details of the project circumstances will help the community provide the best solutions and potential updates. |
@johnabrams7 I had errors with passport.js because in first two examples variable req.user was undefined, and it break template. Request is not lost) Variables - session, user and some other in request dying (or may be not setted) somewhere before police function (from my example) was called. I think object request in this three cases must be identical, and don't lose any variables. I forgot - code of FrontController.testPage controllers/FrontController.js module.exports = {
async testPage(req, res) {
res.view('pages/homepage')
},
}
For the clarity i moved this examples into new clean project, created with
command, and then create this issue |
@westtrade I think you're right about the other issue you linked to. My guess is that this is related to Passport, but without being able to reproduce it, I can't be 100% sure. I tried what you posted initially (without passport) and couldn't reproduce an issue. If you're seeing this issue without Passport, would you create a repo with a new Sails app (without Passport installed) that demonstrates it? Thank you! |
Sails version: v1.0.2
Node version: v10.8.0
NPM version: 6.2.0
DB adapter name: N/A
DB adapter version: N/A
Operating system: Linux 4.15.0-38-generic #41-Ubuntu SMP Wed Oct 10 10:59:38 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I have simple function defined in config/police.js
And three test routes in config/routes.js
this code produce bug with lost request variables, such as session, user and other
I think this issue maybe related to #4427
The text was updated successfully, but these errors were encountered: