diff --git a/src/database.ts b/src/database.ts index 33319c8..09ef40d 100644 --- a/src/database.ts +++ b/src/database.ts @@ -254,11 +254,11 @@ export async function addPNIDConnectionDiscord(pnid: HydratedPNIDDocument, data: export async function removePNIDConnection(pnid: HydratedPNIDDocument, type: string): Promise { // * Add more connections later? if (type === 'discord') { - return await removeUserConnectionDiscord(pnid); + return await removePNIDConnectionDiscord(pnid); } } -export async function removeUserConnectionDiscord(pnid: HydratedPNIDDocument): Promise { +export async function removePNIDConnectionDiscord(pnid: HydratedPNIDDocument): Promise { await PNID.updateOne({ pid: pnid.pid }, { $set: { 'connections.discord.id': '' diff --git a/src/util.ts b/src/util.ts index d43d14a..16b1b08 100644 --- a/src/util.ts +++ b/src/util.ts @@ -70,7 +70,7 @@ export async function generateToken(cryptoOptions: CryptoOptions | null, tokenOp encryptedBody = Buffer.concat([encryptedBody, cipher.final()]); return encryptedBody.toString('base64'); - } else if (!tokenOptions.access_level || !tokenOptions.title_id) { + } else if (tokenOptions.access_level === undefined || tokenOptions.title_id === undefined) { return null; }