Skip to content
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

logoutSessionsOnSensitiveChanges Warning #3175

Closed
cfjedimaster opened this issue Feb 1, 2017 · 10 comments
Closed

logoutSessionsOnSensitiveChanges Warning #3175

cfjedimaster opened this issue Feb 1, 2017 · 10 comments

Comments

@cfjedimaster
Copy link

cfjedimaster commented Feb 1, 2017

Bug/Feature request

LoopBack 2 now adds a warning when you use a User model and do NOT set logoutSessionsOnSensitiveChanges to true. This is fine and all, but you get the warning twice - once for User, and once for your model that extends User. While it is possible that a person may use User, since we always tell people to extend it, the warning should be disable for the User model itself.

Expected result

Don't warn twice.

@cfjedimaster
Copy link
Author

Sorry - this was LoopBack 2, not 3.

@ritch ritch changed the title Warning logoutSessionsOnSensitiveChanges Warning Feb 3, 2017
@zealseeker
Copy link

Do you know how to configure the json file of the User models and whether should we add into user.json in loopback modules or the persisted models we create? If the former, I am afraid it will warn again as long as I update loopback for fixing some bugs.

@cfjedimaster
Copy link
Author

Well since this is apparently gone in 3 (I believe), it may be a non-issue.

@zealseeker
Copy link

zealseeker commented Feb 17, 2017

I solved this problem by adding "logoutSessionsOnSensitiveChanges": true in server/config.json.

@bajtos
Copy link
Member

bajtos commented Mar 1, 2017

@cfjedimaster it makes me wonder, does your server/model-config.json perhaps include both the built-in User model and the custom user model? If that's the case, then you should remove the User entry from your server/model-config.json file. IIRC, we print the warning for each User-like model configured in the application.

@bajtos bajtos self-assigned this Mar 1, 2017
@cfjedimaster
Copy link
Author

Well to be clear, if this is gone in 3, we can close it, right?

@bajtos
Copy link
Member

bajtos commented Mar 1, 2017

LoopBack 2.x is still a supported version and I think most people have not migrated to 3.x yet. Therefore the issue may affect many LoopBack users, IMO it's worth investigating and fixing.

@zealseeker
Copy link

zealseeker commented Mar 1, 2017

Hi, @bajtos . When I set logoutSessionsOnSensitiveChanges as true in config.json, error will happen:

TypeError: Cannot read property 'email' of undefined
at /root/loopback/bestjobs/node_modules/loopback/common/models/user.js:884:80

Then I removed this line. Interestingly, the newest version did not warn again. But I think this logoutSessionsOnSensitiveChanges is recommended by you, isn't it?

@cfjedimaster
Copy link
Author

I'll check - I'm on the road this week though so its going to be hard to find time.

@bajtos
Copy link
Member

bajtos commented Mar 2, 2017

@zealseeker please open a new issue and provide steps to reproduce the issue - see http://loopback.io/doc/en/contrib/Reporting-issues.html#bug-report

@stale stale bot added the stale label Aug 23, 2017
@stale stale bot closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants