Fix JSON parsing for fleetdm.com EST certificate issuance (#23977)

Missed a JSON.parse after refactoring the HTTP request code. This was
missed because we had to comment out some of the code for testing in
order to skip authentication.
This commit is contained in:
Zach Wasserman 2024-11-20 09:50:18 -08:00 committed by GitHub
parent e4df954b0f
commit 31c8edbd9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,11 +83,11 @@ module.exports = {
throw 'invalidToken';
}
if (!introspectResponse.body.active) {
const introspectBody = JSON.parse(introspectResponse.body);
if (!introspectBody.active) {
throw 'invalidToken';
}
const introspectUsername = introspectResponse.body.username;
const introspectUsername = introspectBody.username;
// Extract the email and username from the CSR. Ensure they match.
let jsrsasign = require('jsrsasign');