Skip to content

Commit aae6687

Browse files
committed
server/types/apiKey: update to add comment about token property on last item of return of createApiKeys
1 parent 0ddb69d commit aae6687

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/controllers/user.controller/apiKey.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ export const createApiKey: RequestHandler<
6767
await user.save();
6868

6969
const apiKeys = user.apiKeys.map((apiKey, index) => {
70-
const fields = apiKey.toObject!();
70+
const fields = apiKey.toObject();
71+
// only include the token of the most recently made apiKey to display in the copiable field
7172
const shouldIncludeToken = index === addedApiKeyIndex - 1;
7273

7374
return shouldIncludeToken ? { ...fields, token: keyToBeHashed } : fields;

0 commit comments

Comments
 (0)