소스 검색

fix auth time lookup

Grant Limberg 4 년 전
부모
커밋
fd174b3459
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      controller/PostgreSQL.cpp

+ 2 - 2
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