We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ddb69d commit aae6687Copy full SHA for aae6687
server/controllers/user.controller/apiKey.ts
@@ -67,7 +67,8 @@ export const createApiKey: RequestHandler<
67
await user.save();
68
69
const apiKeys = user.apiKeys.map((apiKey, index) => {
70
- const fields = apiKey.toObject!();
+ const fields = apiKey.toObject();
71
+ // only include the token of the most recently made apiKey to display in the copiable field
72
const shouldIncludeToken = index === addedApiKeyIndex - 1;
73
74
return shouldIncludeToken ? { ...fields, token: keyToBeHashed } : fields;
0 commit comments