From 8fbeda892bf42041252c06f322a7eaac48306119 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 12 Dec 2023 09:39:39 +0700 Subject: [PATCH] fix: must have length or will fail --- Services/server/src/utils/auth.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/Services/server/src/utils/auth.ts b/Services/server/src/utils/auth.ts index 0c0835a..0f56597 100644 --- a/Services/server/src/utils/auth.ts +++ b/Services/server/src/utils/auth.ts @@ -57,6 +57,7 @@ export async function expressAuthentication( if ( scopes && + scopes.length > 0 && scopes .map((v) => (v === "management-role" ? process.env.MANAGEMENT_ROLE : v)) .every((v) => !payload.resource_access[payload.azp].roles.includes(v))