Skip to content

Commit

Permalink
Updating user count validation (#1430)
Browse files Browse the repository at this point in the history
This change is to address
https://app.asana.com/0/808093868887967/1188274656222915 . These problems were
brought to our attention via our 2019 engagement with TrustedCI. Specifically,
we now ensure that only a single user record is returned from these queries,
anything else is considered an exception.
  • Loading branch information
ryanrath authored Aug 25, 2020
1 parent 691a5ae commit 89466b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/Rest/Utilities/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private static function resolveUserFromToken(
$resolver_query_params
);

if (count($user_check) > 0) {
if (count($user_check) === 1) {
$last_active_time = self::getMicrotime();

$last_active_query = "
Expand Down
3 changes: 2 additions & 1 deletion classes/XDUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,8 @@ public static function authenticate($uname, $pass)
'user_type' => SSO_USER_TYPE
)
);
if (count($userCheck) == 0) {

if (count($userCheck) !== 1) {
return null;
}

Expand Down

0 comments on commit 89466b8

Please sign in to comment.