Skip to content

Commit ca3e22c

Browse files
committed
Merge pull request #72 from Annyv2/compatibility
Compatibility with new version of Auth0php
2 parents cb02dbf + 64eae20 commit ca3e22c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/basic-api/src/Main.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ public function publicPing(){
2727

2828
public function privatePing(){
2929

30-
$userData = \Auth0\SDK\Api\ApiUsers::get(getenv('AUTH0_DOMAIN'),$this->token, $this->tokenInfo->sub);
31-
30+
$auth0Api = new \Auth0\SDK\Auth0Api($this->token, getenv('AUTH0_DOMAIN'));
31+
$userData = $auth0Api->users->get($this->tokenInfo->sub);
32+
3233
return array(
3334
"status" => 'ok',
3435
"message" => 'Shh, it\' secret',
3536
"user" => array(
3637
"email" => $userData["email"],
37-
"username" => $userData["username"]
38+
"name" => $userData["name"]
3839
)
3940
);
4041
}

0 commit comments

Comments
 (0)