summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2022-12-24 16:28:41 -0500
committerPuyodead1 <puyodead@proton.me>2023-03-18 19:28:45 -0400
commit7e10d73dac766554ea5cb70214887fbce1df4a85 (patch)
tree40f702df41db13b36866230c3d5a2f74d22bc9c1 /src
parentAdd Twitch, error handling, revokation changes, etc (diff)
downloadserver-7e10d73dac766554ea5cb70214887fbce1df4a85.tar.xz
use connection revoked error
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/users/@me/connections/#connection_name/#connection_id/access-token.ts3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/api/routes/users/@me/connections/#connection_name/#connection_id/access-token.ts b/src/api/routes/users/@me/connections/#connection_name/#connection_id/access-token.ts
index 1ad1c7a7..3f4de8b5 100644
--- a/src/api/routes/users/@me/connections/#connection_name/#connection_id/access-token.ts
+++ b/src/api/routes/users/@me/connections/#connection_name/#connection_id/access-token.ts
@@ -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);