Fixed token generation for production users

This commit is contained in:
Jonathan Barrow
2023-03-30 10:22:31 -04:00
parent 7734879130
commit 00b1aecd70
2 changed files with 3 additions and 3 deletions

View File

@@ -254,11 +254,11 @@ export async function addPNIDConnectionDiscord(pnid: HydratedPNIDDocument, data:
export async function removePNIDConnection(pnid: HydratedPNIDDocument, type: string): Promise<ConnectionResponse | undefined> {
// * Add more connections later?
if (type === 'discord') {
return await removeUserConnectionDiscord(pnid);
return await removePNIDConnectionDiscord(pnid);
}
}
export async function removeUserConnectionDiscord(pnid: HydratedPNIDDocument): Promise<ConnectionResponse> {
export async function removePNIDConnectionDiscord(pnid: HydratedPNIDDocument): Promise<ConnectionResponse> {
await PNID.updateOne({ pid: pnid.pid }, {
$set: {
'connections.discord.id': ''

View File

@@ -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;
}