mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-09-30 22:28:00 -05:00
Fixed token generation for production users
This commit is contained in:
@@ -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': ''
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user