Remove router-nli-app and don't fingerprint anonymous users
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
- I've checked all classes mentioned in the
- makes sure that we call fingerprinting only for logged in users
- this prevents common
500
error in production
- this prevents common
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
.
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 (OOO back on 2024-05-09)