Skip to content

Remove router-nli-app and don't fingerprint anonymous users

Tomas Vik requested to merge remove-nli-router into develop

Found during work on #2346 (closed)

Fixes two related issues:

  • the router-nli-app js and less files are no longer used by the app
    • I've checked all classes mentioned in the router-nli-app.less and they weren't used in the project
  • makes sure that we call fingerprinting only for logged in users
    • this prevents common 500 error in production

Fingerprinting issue in production

Since we are using only router-app now, we call the fingerprint logic every time the app gets initialized, even if the user isn't logged in. This results in expecting the req.user to exists and failing to dereference req.user._id.

Screenshot_2019-11-13_at_10.38.30_AM

Screenshot_2019-11-13_at_10.37.47_AM

Testing locally

To temporarily work around #2346 (closed) you can apply this patch

diff --git a/server/web/express.js b/server/web/express.js
index b856852af..6e81868e9 100644
--- a/server/web/express.js
+++ b/server/web/express.js
@@ -125,7 +125,7 @@ module.exports = {
     app.use(passport.initialize());
     app.use(passport.session());

-    app.use(require('./middlewares/authenticate-bearer'));
+    //app.use(require('./middlewares/authenticate-bearer'));
     app.use(rememberMe.rememberMeMiddleware);
     app.use(require('./middlewares/rate-limiter'));
     app.use(require('./middlewares/record-client-usage-stats'));

And then just access any chat room when not logged in.

Edited by Tomas Vik

Merge request reports