Skip to content

Commit

Permalink
Check for sub if user_id is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot-sawyer committed Jul 20, 2022
1 parent 501238d commit 5659b5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Auth0ResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ public function __construct(array $response = [])
*/
public function getId()
{
return $this->getValueByKey($this->response, 'user_id');
$id = $this->getValueByKey($this->response, 'user_id');
if(!$id) {
$id = $this->getValueByKey($this->response, 'sub');
}

return $id;
}

/**
Expand Down

0 comments on commit 5659b5e

Please sign in to comment.