Skip to content

Commit

Permalink
fix: api token not serialized properly on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffroy Empain committed Jan 5, 2021
1 parent ea1beea commit 9224592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/entities/api/handlers/tokens/create-api-token.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { body } from '../../../../commons/express-joi/body';
import { Request, Response } from 'express';
import { uuid } from '../../../../utils/uuid';
import { serializeSiteToken } from '../../../sites/serialize-site-token';
import { emitEvent } from '../../../../events/emit-event';
import { wrapAsyncMiddleware } from '../../../../commons/utils/wrap-async-middleware';
import { getUser } from '../../../../auth/utils/get-user';
import { $apiToken, ApiToken, ApiTokens } from '../../api-token';
import { EventType } from '../../../../events/event-type';
import { generateTokenValue } from '../../../../utils/generate-token-value';
import { serializeApiToken } from '../../serialize-api-token';

const validators = [
body($apiToken),
Expand All @@ -34,7 +34,7 @@ async function handler(req: Request, res: Response): Promise<void> {
apiToken,
});

res.json(serializeSiteToken(apiToken));
res.json(serializeApiToken(apiToken));
}

/*
Expand Down

0 comments on commit 9224592

Please sign in to comment.