From ff5d8f8bdbc126657df780a0bce529703e73f58b Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 21 Nov 2024 20:07:42 +0000 Subject: [PATCH] Added support for identify:email scope. --- src/V1/V1UsersRoutes.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/V1/V1UsersRoutes.php b/src/V1/V1UsersRoutes.php index 2f2ebbe..51b10d0 100644 --- a/src/V1/V1UsersRoutes.php +++ b/src/V1/V1UsersRoutes.php @@ -27,7 +27,10 @@ class V1UsersRoutes implements RouteHandler { } if($authz->isRealUser()) { - $userInfo = $this->rpc->query('getUser', ['userId' => $authz->getUserId()]); + $userInfo = $this->rpc->query('getUser', [ + 'userId' => $authz->getUserId(), + 'includeEMailAddress' => $authz->hasScope('identify:email'), + ]); if(!is_array($userInfo)) return 500; if(array_key_exists('error', $userInfo))