3 const StatusError = require('statuserror');
4 var fingerprintingService = require('gitter-web-fingerprinting/lib/fingerprinting-service');
7 * Submit a browser fingerprint for a user's browser
9 module.exports = function(req, res, next) {
10 if (!req.user) return next(new StatusError(401, 'Anonymous users cannot be fingerprinted'));
11 var userId = req.user._id;
12 var fingerprint = req.body && req.body.fp;
14 return fingerprintingService
15 .recordFingerprint(userId, fingerprint, req.ip)