From 4a3bbeec79ebf26ada1860aa3bc9fe136ab9ebac Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Wed, 10 Apr 2024 11:33:44 +0200 Subject: [PATCH] formatting --- src/APnutI.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/APnutI.php b/src/APnutI.php index 2bfbc08..ad07ce3 100644 --- a/src/APnutI.php +++ b/src/APnutI.php @@ -335,17 +335,21 @@ class APnutI return $this->makeRequest('get', $end_point, $parameters, $content_type, $follow_redirect); } - public function getAuthURL() + public function getAuthURL($append_redirect_query_string = null) { - $url = $this->auth_url - . '?client_id=' - . $this->client_id - . '&redirect_uri=' - . urlencode($this->redirect_uri) - . '&scope='.$this->needed_scope - . '&response_type=code'; - $this->logger->debug('Auth URL: ' . $url); - return $url; + $redirect_uri = $this->redirect_uri; + if (!empty($append_redirect_query_string)) { + $redirect_uri .= $append_redirect_query_string; + } + $url = $this->auth_url + . '?client_id=' + . $this->client_id + . '&redirect_uri=' + . urlencode($redirect_uri) + . '&scope='.$this->needed_scope + . '&response_type=code'; + $this->logger->debug('Auth URL: ' . $url); + return $url; } //TODO: Ping server and validate token