From e6cfedd34063f34495dc0197c188a9a26a15ffdd Mon Sep 17 00:00:00 2001 From: Harsh Mahajan Date: Wed, 8 Apr 2026 18:27:36 +0530 Subject: [PATCH] addressed greptile comment --- src/Appwrite/Auth/OAuth2/X.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Appwrite/Auth/OAuth2/X.php b/src/Appwrite/Auth/OAuth2/X.php index e161cf41b4..a2c6f81312 100644 --- a/src/Appwrite/Auth/OAuth2/X.php +++ b/src/Appwrite/Auth/OAuth2/X.php @@ -252,6 +252,10 @@ class X extends OAuth2 $data = OpenSSL::encrypt($verifier, OpenSSL::CIPHER_AES_128_GCM, $key, OPENSSL_RAW_DATA, $iv, $tag); + if ($data === false || $tag === null) { + throw new \RuntimeException('Failed to encrypt PKCE verifier.'); + } + return [ 'data' => $this->base64UrlEncode($data), 'iv' => \bin2hex($iv),