1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

use connection revoked error

This commit is contained in:
Puyodead1 2022-12-24 16:28:41 -05:00
parent 6d6944cfee
commit 7e10d73dac
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC

View File

@ -58,8 +58,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
],
});
if (!connectedAccount) throw DiscordApiErrors.UNKNOWN_CONNECTION;
if (connectedAccount.revoked)
throw new ApiError("Connection revoked", 0, 400);
if (connectedAccount.revoked) throw DiscordApiErrors.CONNECTION_REVOKED;
if (!connectedAccount.token_data)
throw new ApiError("No token data", 0, 400);