summaryrefslogtreecommitdiff
path: root/controller/PostgreSQL.cpp
diff options
context:
space:
mode:
authorGrant Limberg <[email protected]>2021-06-04 20:55:22 -0700
committerGrant Limberg <[email protected]>2021-06-04 20:55:22 -0700
commitfd174b34598fb5d3aa404ea1f10994ef0ad9d20a (patch)
tree08e85c101582cb5f379d5ec851f56a8f9497287c /controller/PostgreSQL.cpp
parent21d27c314c6dd3a84797898c0b23ecd85b3ce289 (diff)
fix auth time lookup
Diffstat (limited to 'controller/PostgreSQL.cpp')
-rw-r--r--controller/PostgreSQL.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp
index da872b1e..0298a863 100644
--- a/controller/PostgreSQL.cpp
+++ b/controller/PostgreSQL.cpp
@@ -694,8 +694,8 @@ void PostgreSQL::initializeMembers()
"FROM ztc_sso_expiry e "
"INNER JOIN ztc_network n "
" ON n.id = e.network_id "
- "WHERE e.network_id = $1 AND e.member_id = $2 AND n.sso_enabled = TRUE "
- "ORDER BY e.authentication_expiry_time LIMIT 1", networkId, memberId);
+ "WHERE e.network_id = $1 AND e.member_id = $2 AND n.sso_enabled = TRUE AND e.authentication_expiry_time IS NOT NULL "
+ "ORDER BY e.authentication_expiry_time DESC LIMIT 1", networkId, memberId);
if (authRes.size() == 1 && !authRes.at(0)[0].is_null()) {
// there is an expiry time record