Merge branch 'hotfix/21.56.9' into master
[gitter.git] / server / event-listeners / destroy-user-tokens-listener.js
blobd5c4d89e46cd6206fa3fdb5dfe9dfaf78dae0eae
1 'use strict';
3 var appEvents = require('gitter-web-appevents');
4 var userService = require('gitter-web-users');
6 var installed = false;
7 exports.install = function() {
8   if (installed) return;
9   installed = true;
11   appEvents.onDestroyUserTokens(function(userId) {
12     return userService.destroyTokensForUserId(userId);
13   });