mirror of
https://github.com/detleph/server.git
synced 2026-09-08 07:56:18 +02:00
FIX: RequireAuthentication now throws on wrong auth type
This commit is contained in:
@@ -69,7 +69,7 @@ const _requireAdminAuthentication =
|
|||||||
|
|
||||||
if (!token_payload.permission_level || !token_payload.pid || !token_payload.revision) {
|
if (!token_payload.permission_level || !token_payload.pid || !token_payload.revision) {
|
||||||
if (typeof (token_payload as unknown as TeamleaderJWTPayload).team === "string") {
|
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!");
|
throw new AuthError("The token did not include the required information!");
|
||||||
|
|||||||
Reference in New Issue
Block a user