moar temporary debug printfs

This commit is contained in:
Grant Limberg 2021-06-04 11:00:51 -07:00
parent 287c19e822
commit c78792a705
No known key found for this signature in database
GPG Key ID: 2BA62CCABBB4095A

View File

@ -1333,13 +1333,18 @@ void EmbeddedNetworkController::_request(
bool memberSSOExempt = OSUtils::jsonBool(member["ssoExempt"], false); bool memberSSOExempt = OSUtils::jsonBool(member["ssoExempt"], false);
if (networkSSOEnabled && !memberSSOExempt) { if (networkSSOEnabled && !memberSSOExempt) {
std::string memberId = member["id"];
fprintf(stderr, "ssoEnabled && !ssoExempt %s-%s\n", nwids, memberId.c_str());
int64_t authenticationExpiryTime = (int64_t)OSUtils::jsonInt(member["authenticationExpiryTime"], 0); int64_t authenticationExpiryTime = (int64_t)OSUtils::jsonInt(member["authenticationExpiryTime"], 0);
fprintf(stder, "authExpiryTime: %l\n", authenticationExpiryTime);
if ((authenticationExpiryTime == 0) || (authenticationExpiryTime < now)) { if ((authenticationExpiryTime == 0) || (authenticationExpiryTime < now)) {
Dictionary<1024> authInfo; Dictionary<1024> authInfo;
std::string authenticationURL = _db.getSSOAuthURL(member); std::string authenticationURL = _db.getSSOAuthURL(member);
if (!authenticationURL.empty()) { if (!authenticationURL.empty()) {
authInfo.add("aU", authenticationURL.c_str()); authInfo.add("aU", authenticationURL.c_str());
} }
fprintf(stderr, "sending auth URL: %s\n", authenticationURL.c_str());
_sender->ncSendError(nwid,requestPacketId,identity.address(),NetworkController::NC_ERROR_AUTHENTICATION_REQUIRED, authInfo.data(), authInfo.sizeBytes()); _sender->ncSendError(nwid,requestPacketId,identity.address(),NetworkController::NC_ERROR_AUTHENTICATION_REQUIRED, authInfo.data(), authInfo.sizeBytes());
return; return;
} }