3 var oauthService
= require('gitter-web-oauth');
4 var restSerializer
= require('../../serializers/rest-serializer');
5 var Promise
= require('bluebird');
7 module
.exports = function(req
, res
, next
) {
8 var strategy
= new restSerializer
.UserStrategy();
11 restSerializer
.serializeObject(req
.user
, strategy
),
12 oauthService
.findOrGenerateIRCToken(req
.user
.id
),
13 function(serialized
, token
) {
14 res
.send({ token
: token
, user
: serialized
});