From 339ecff938b4317e85870fb24747f81f49000fb6 Mon Sep 17 00:00:00 2001 From: Stephan <57194608+stephan418@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:42:47 +0200 Subject: [PATCH] FIX: RequireAuthentication now throws on wrong auth type --- src/Middleware/auth/auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Middleware/auth/auth.ts b/src/Middleware/auth/auth.ts index 75e20c7..949f8bc 100644 --- a/src/Middleware/auth/auth.ts +++ b/src/Middleware/auth/auth.ts @@ -69,7 +69,7 @@ const _requireAdminAuthentication = if (!token_payload.permission_level || !token_payload.pid || !token_payload.revision) { if (typeof (token_payload as unknown as TeamleaderJWTPayload).team === "string") { - return false; + throw new AuthError("Teamleader authentication is not supported for this operation!"); } throw new AuthError("The token did not include the required information!");