queerviolet / bones

MIT License
36 stars 119 forks source link

Passport user deserialization errors with stale cookies #28

Closed glebec closed 7 years ago

glebec commented 7 years ago

During development of a Bones-based app, one sometimes has stale cookies logged in as a user who no longer exists in the current database. This causes the server error Cannot read property 'id' of null.

If possible, it would be good to automatically clear the session on this error, so that the developer does not have to manually delete cookies.