From 983eee92666e5320bd0c0f3728627a928aeee0c6 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 17 Jan 2025 07:14:48 +0000 Subject: [PATCH] chore: added error handling to user --- src/Appwrite/Auth/OAuth2/Slack.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/Slack.php b/src/Appwrite/Auth/OAuth2/Slack.php index a022f31347..6f59e416d8 100644 --- a/src/Appwrite/Auth/OAuth2/Slack.php +++ b/src/Appwrite/Auth/OAuth2/Slack.php @@ -172,6 +172,10 @@ class Slack extends OAuth2 ); $this->user = \json_decode($user, true); + + if (!$this->user['ok']) { + throw new \Exception('Error in fetching user.'); + } } return $this->user;