Merge branch 'hotfix/21.56.9' into master
[gitter.git] / server / serializers / rest / oauth-access-token-strategy.js
blobaffccf4952642fa9a467c1f000c7ece5f082a720
1 'use strict';
3 const obfuscateToken = require('gitter-web-github').obfuscateToken;
5 class OauthAccessTokenStrategy {
6 preload() {}
8 map(accessToken) {
9 var id = accessToken.id || (accessToken._id && accessToken._id.toHexString());
11 return {
12 id,
13 token: obfuscateToken(accessToken.token),
14 userId: accessToken.userId,
15 clientId: accessToken.clientId,
16 expires: accessToken.expires
21 module.exports = OauthAccessTokenStrategy;