From 141a1f9379224a4aab8d1bcc6449a98f03c2bdb0 Mon Sep 17 00:00:00 2001 From: Hickmeister <35031453+Hickmeister@users.noreply.github.com> Date: Sun, 11 Oct 2026 17:42:20 +0100 Subject: [PATCH] Request core Parcel2Go profile scopes first --- app/Services/Parcel2Go.php | 2 +- resources/views/settings/index.blade.php | 2 +- tests/Feature/Parcel2GoOAuthTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Services/Parcel2Go.php b/app/Services/Parcel2Go.php index a770cd2..ea49769 100644 --- a/app/Services/Parcel2Go.php +++ b/app/Services/Parcel2Go.php @@ -60,7 +60,7 @@ class Parcel2Go 'client_id' => $settings['profile_client_id'], 'redirect_uri' => route('parcel2go.callback'), 'response_type' => 'code', - 'scope' => 'public-api my-profile offline_access', + 'scope' => 'public-api my-profile', 'state' => $state, 'code_challenge' => rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '='), 'code_challenge_method' => 'S256', diff --git a/resources/views/settings/index.blade.php b/resources/views/settings/index.blade.php index 318b1bb..9e9854c 100644 --- a/resources/views/settings/index.blade.php +++ b/resources/views/settings/index.blade.php @@ -71,7 +71,7 @@

Parcel2Go account consent

$integrations['parcel2go']['profile_connected'], 'bg-amber-500/10 text-amber-200' => ! $integrations['parcel2go']['profile_connected']])>{{ $integrations['parcel2go']['profile_connected'] ? 'Connected' : 'Not connected' }}

Create an Authorization Code client in Parcel2Go. Set Application URL to {{ url('/') }} and Redirect URI to this exact address:

{{ $integrations['parcel2go']['callback_url'] }} -

Save its Client ID above, then sign in and approve my-profile access. The account tokens are encrypted in the database. If consent rejects this scope, contact apihelp@parcel2go.com.

+

Save its Client ID above, then sign in and approve my-profile access. The account tokens are encrypted in the database. If Parcel2Go does not issue a refresh token, reconnect when access expires. If consent rejects this scope, contact apihelp@parcel2go.com.

@if($integrations['parcel2go']['profile_client_configured'])
@csrf
@endif diff --git a/tests/Feature/Parcel2GoOAuthTest.php b/tests/Feature/Parcel2GoOAuthTest.php index ab377df..e0de0df 100644 --- a/tests/Feature/Parcel2GoOAuthTest.php +++ b/tests/Feature/Parcel2GoOAuthTest.php @@ -36,7 +36,7 @@ class Parcel2GoOAuthTest extends TestCase $this->assertSame('https://auth.example.test/connect/authorize', strtok($response->headers->get('Location'), '?')); $this->assertSame('profile-client', $query['client_id']); $this->assertSame(route('parcel2go.callback'), $query['redirect_uri']); - $this->assertSame('public-api my-profile offline_access', $query['scope']); + $this->assertSame('public-api my-profile', $query['scope']); $this->assertSame('S256', $query['code_challenge_method']); $this->assertSame($pending['state'], $query['state']); $this->assertSame(rtrim(strtr(base64_encode(hash('sha256', $pending['verifier'], true)), '+/', '-_'), '='), $query['code_challenge']);