fix: wording and small adjustment

This commit is contained in:
Methapon2001 2023-12-13 18:01:32 +07:00
parent 7f440c40e9
commit 0f694ea777
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
4 changed files with 75 additions and 14 deletions

View file

@ -38,7 +38,7 @@ export async function expressAuthentication(
? request.headers["authorization"].split(" ")[1]
: null;
if (!token) throw new HttpError(HttpStatusCode.UNAUTHORIZED, "ไม่พบข้อมูลสำหัรบบืนบันตัวตน");
if (!token) throw new HttpError(HttpStatusCode.UNAUTHORIZED, "ไม่พบข้อมูลสำหรับยินยันตัวตน");
let payload: JwtPayload = {};
@ -60,7 +60,7 @@ export async function expressAuthentication(
scopes.length > 0 &&
scopes
.map((v) => (v === "management-role" ? process.env.MANAGEMENT_ROLE : v))
.every((v) => !payload.resource_access[payload.azp].roles.includes(v))
.every((v) => !payload.role.includes(v))
) {
throw new HttpError(HttpStatusCode.FORBIDDEN, "คุณไม่มีสิทธิในเข้าถึงข้อมูลนี้");
}