From f6385c716ed57ab13bebbe12eb3aecb16859a110 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 21 Jan 2025 12:17:48 +0000 Subject: [PATCH] fix: encoding state --- src/Appwrite/Auth/OAuth2/Amazon.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index d1d2cb5a38..2fa3f4cfe9 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -43,7 +43,7 @@ class Amazon extends OAuth2 */ public function parseState(string $state) { - return \json_decode(\html_entity_decode($state), true); + return \json_decode(\urldecode(\html_entity_decode($state)), true); } @@ -56,7 +56,7 @@ class Amazon extends OAuth2 'response_type' => 'code', 'client_id' => $this->appID, 'scope' => \implode(' ', $this->getScopes()), - 'state' => \json_encode($this->state), + 'state' => \urlencode(\json_encode($this->state)), 'redirect_uri' => $this->callback ]); }