Skip to content

Commit

Permalink
temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ginsleepy committed Aug 17, 2020
1 parent b9352b8 commit 4e004cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/API/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function sms_passwordless_start(string $phone_number, ?string $forwarded_
public function userinfo(string $access_token) : array
{
return $this->apiClient->method('get')
->addPath('userinfo')
->addPath('authenticate', 'user')
->withHeader(new AuthorizationBearer($access_token))
->call();
}
Expand Down Expand Up @@ -375,7 +375,7 @@ public function oauth_token(array $options = []) : array
}

$request = $this->apiClient->method('post')
->addPath( 'oauth', 'token' )
->addPath( 'authenticate', 'oauth', 'token' )
->withBody(json_encode($options));

if (isset($options['auth0_forwarded_for'])) {
Expand Down
25 changes: 13 additions & 12 deletions src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,26 +528,27 @@ public function exchange()
if (empty($response['access_token'])) {
throw new ApiException('Invalid access_token - Retry login.');
}


$this->setAccessToken($response['access_token']);

if (isset($response['refresh_token'])) {
$this->setRefreshToken($response['refresh_token']);
}

if (isset($response['id_token'])) {
if (! $this->transientHandler->isset(self::TRANSIENT_NONCE_KEY)) {
throw new InvalidTokenException('Nonce value not found in application store');
}

$this->setIdToken($response['id_token']);
}
// if (isset($response['id_token'])) {
// if (! $this->transientHandler->isset(self::TRANSIENT_NONCE_KEY)) {
// throw new InvalidTokenException('Nonce value not found in application store');
// }

if ($this->skipUserinfo) {
$user = $this->idTokenDecoded;
} else {
$user = $this->authentication->userinfo($this->accessToken);
}
// $this->setIdToken($response['id_token']);
// }
// if ($this->skipUserinfo) {
// $user = $this->idTokenDecoded;
// } else {
// $user = $this->authentication->userinfo($this->accessToken);
// }
$user = $this->authentication->userinfo($this->accessToken);

if ($user) {
$this->setUser($user);
Expand Down

0 comments on commit 4e004cd

Please sign in to comment.