fix: must have length or will fail

This commit is contained in:
Methapon2001 2023-12-12 09:39:39 +07:00
parent 23e072986d
commit 8fbeda892b
No known key found for this signature in database
GPG key ID: 849924FEF46BD132

View file

@ -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))