diff options
| author | Adam Ierymenko <[email protected]> | 2021-08-10 11:22:29 -0400 |
|---|---|---|
| committer | Adam Ierymenko <[email protected]> | 2021-08-10 11:22:29 -0400 |
| commit | 461810b06aa033e21c35716f7c6d8dc80c9075f0 (patch) | |
| tree | 5a057c2afb88de89c23f98b099f14c93f5daaf62 /controller/EmbeddedNetworkController.cpp | |
| parent | 20050662b2936c9e89885794a94f9a21b8dcd321 (diff) | |
Move return so record gets created before URL.
Diffstat (limited to 'controller/EmbeddedNetworkController.cpp')
| -rw-r--r-- | controller/EmbeddedNetworkController.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index d228a368..9a4a0984 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1361,14 +1361,13 @@ void EmbeddedNetworkController::_request( bool networkSSOEnabled = OSUtils::jsonBool(network["ssoEnabled"], false); bool memberSSOExempt = OSUtils::jsonBool(member["ssoExempt"], false); std::string authenticationURL; - if (networkSSOEnabled && !memberSSOExempt) { authenticationURL = _db.getSSOAuthURL(member, _ssoRedirectURL); std::string memberId = member["id"]; fprintf(stderr, "ssoEnabled && !ssoExempt %s-%s\n", nwids, memberId.c_str()); uint64_t authenticationExpiryTime = (int64_t)OSUtils::jsonInt(member["authenticationExpiryTime"], 0); fprintf(stderr, "authExpiryTime: %lld\n", authenticationExpiryTime); - if (authenticationExpiryTime >= now) { + if (authenticationExpiryTime < now) { if (!authenticationURL.empty()) { Dictionary<3072> authInfo; authInfo.add("aU", authenticationURL.c_str()); @@ -1376,8 +1375,8 @@ void EmbeddedNetworkController::_request( DB::cleanMember(member); _db.save(member,true); _sender->ncSendError(nwid,requestPacketId,identity.address(),NetworkController::NC_ERROR_AUTHENTICATION_REQUIRED, authInfo.data(), authInfo.sizeBytes()); + return; } - return; } else if (authorized) { _db.memberWillExpire(authenticationExpiryTime, nwid, identity.address().toInt()); } |
