Skip to content

Commit

Permalink
If more than one user is found, something is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Sep 14, 2023
1 parent 53dc5b4 commit ea29354
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Storage/AuthorizationCodeStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ private function getUserIdByCode( $code ) {
return null;
}

if ( count( $users ) > 1 ) {
// This should never happen.
// If it does, something is wrong, so it's best to not return any user.
return null;
}

return absint( $users[0]->ID );
}

Expand Down

0 comments on commit ea29354

Please sign in to comment.