diff --git a/src/routes/generateToken.ts b/src/routes/generateToken.ts index 6190ebd..575df4c 100644 --- a/src/routes/generateToken.ts +++ b/src/routes/generateToken.ts @@ -25,10 +25,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo if (type === TokenType.patreon || ([TokenType.local, TokenType.gift].includes(type) && adminUserIDHash === config.adminUserID) || type === TokenType.free) { - const licenseKey = await createAndSaveToken(type, code, adminUserIDHash === config.adminUserID ? parseInt(total) : 1); + const licenseKeys = await createAndSaveToken(type, code, adminUserIDHash === config.adminUserID ? parseInt(total) : 1); /* istanbul ignore else */ - if (licenseKey) { + if (licenseKeys) { if (type === TokenType.patreon) { return res.status(200).send(`
- ${licenseKey[0]} + ${licenseKeys[0]}
@@ -45,10 +45,10 @@ export async function generateTokenRequest(req: GenerateTokenRequest, res: Respo
`);
} else if (type === TokenType.free) {
return res.status(200).send({
- licenseKey: licenseKey[0]
+ licenseKey: licenseKeys[0]
});
} else {
- return res.status(200).send(licenseKey.join("
"));
+ return res.status(200).send(licenseKeys.join("
"));
}
} else {
return res.status(401).send(`