diff --git a/src/index.js b/src/index.js index 37514d76..5402f540 100644 --- a/src/index.js +++ b/src/index.js @@ -252,8 +252,15 @@ fastify.post("/api/login", { }; if (loginObject.isStaff) { - responsePayload.simplydata.all_motor_access = loginObject.staffMember.all_motor_access; - } + let allMotorAccess = loginObject.staffMember.all_motor_access; + + // Normalize the value if it matches the given variations + if (["view", "view only", "View", "View Only"].includes(allMotorAccess)) { + allMotorAccess = "view"; + } + + responsePayload.simplydata.all_motor_access = allMotorAccess; + } if (profilePicture) { responsePayload.simplydata.picture = profilePicture.picture;