add isError to sso template variables

This commit is contained in:
Grant Limberg 2022-05-16 09:25:36 -07:00
parent 4c22793850
commit c329fab966
No known key found for this signature in database
GPG Key ID: 8F2F97D3BE8D7735

View File

@ -1713,6 +1713,7 @@ public:
scode = 500;
json data;
outData["isError"] = true;
outData["messageText"] = (std::string("ERROR ") + error + std::string(": ") + desc);
responseBody = inja::render(htmlTemplate, outData);
@ -1741,16 +1742,19 @@ public:
json ssoResult = json::parse(ret);
if (ssoResult.is_object()) {
if (ssoResult.contains("errorMessage")) {
outData["isError"] = true;
outData["messageText"] = ssoResult["errorMessage"];
responseBody = inja::render(htmlTemplate, outData);
scode = 500;
} else {
scode = 200;
outData["isError"] = false;
outData["messageText"] = "Authentication Successful. You may now access the network.";
responseBody = inja::render(htmlTemplate, outData);
}
} else {
// not an object? We got a problem
outData["isError"] = true;
outData["messageText"] = "ERROR: Unkown SSO response. Please contact your administrator.";
responseBody = inja::render(htmlTemplate, outData);
scode= 500;