Request core Parcel2Go profile scopes first
Deploy HickLab3D Dashboard / Deploy to production (push) Successful in 26s

This commit is contained in:
Hickmeister
2026-10-11 17:42:20 +01:00
parent 1be66f099c
commit 141a1f9379
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ class Parcel2Go
'client_id' => $settings['profile_client_id'], 'client_id' => $settings['profile_client_id'],
'redirect_uri' => route('parcel2go.callback'), 'redirect_uri' => route('parcel2go.callback'),
'response_type' => 'code', 'response_type' => 'code',
'scope' => 'public-api my-profile offline_access', 'scope' => 'public-api my-profile',
'state' => $state, 'state' => $state,
'code_challenge' => rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '='), 'code_challenge' => rtrim(strtr(base64_encode(hash('sha256', $verifier, true)), '+/', '-_'), '='),
'code_challenge_method' => 'S256', 'code_challenge_method' => 'S256',
+1 -1
View File
@@ -71,7 +71,7 @@
<div class="flex flex-wrap items-center justify-between gap-2"><p class="font-semibold">Parcel2Go account consent</p><span @class(['rounded-full px-2 py-1 text-xs font-semibold', 'bg-emerald-500/10 text-emerald-300' => $integrations['parcel2go']['profile_connected'], 'bg-amber-500/10 text-amber-200' => ! $integrations['parcel2go']['profile_connected']])>{{ $integrations['parcel2go']['profile_connected'] ? 'Connected' : 'Not connected' }}</span></div> <div class="flex flex-wrap items-center justify-between gap-2"><p class="font-semibold">Parcel2Go account consent</p><span @class(['rounded-full px-2 py-1 text-xs font-semibold', 'bg-emerald-500/10 text-emerald-300' => $integrations['parcel2go']['profile_connected'], 'bg-amber-500/10 text-amber-200' => ! $integrations['parcel2go']['profile_connected']])>{{ $integrations['parcel2go']['profile_connected'] ? 'Connected' : 'Not connected' }}</span></div>
<p class="text-slate-400">Create an <strong>Authorization Code</strong> client in Parcel2Go. Set Application URL to <code>{{ url('/') }}</code> and Redirect URI to this exact address:</p> <p class="text-slate-400">Create an <strong>Authorization Code</strong> client in Parcel2Go. Set Application URL to <code>{{ url('/') }}</code> and Redirect URI to this exact address:</p>
<code class="overflow-x-auto rounded-lg border border-slate-700 bg-slate-900 px-3 py-2 text-slate-200">{{ $integrations['parcel2go']['callback_url'] }}</code> <code class="overflow-x-auto rounded-lg border border-slate-700 bg-slate-900 px-3 py-2 text-slate-200">{{ $integrations['parcel2go']['callback_url'] }}</code>
<p class="text-slate-400">Save its Client ID above, then sign in and approve <code>my-profile</code> access. The account tokens are encrypted in the database. If consent rejects this scope, contact <a class="text-brand hover:underline" href="mailto:apihelp@parcel2go.com">apihelp@parcel2go.com</a>.</p> <p class="text-slate-400">Save its Client ID above, then sign in and approve <code>my-profile</code> 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 <a class="text-brand hover:underline" href="mailto:apihelp@parcel2go.com">apihelp@parcel2go.com</a>.</p>
@if($integrations['parcel2go']['profile_client_configured'])<form method="post" action="{{ route('parcel2go.connect') }}">@csrf<button class="rounded-xl border border-brand/40 px-4 py-2 font-semibold text-brand hover:bg-brand/10">{{ $integrations['parcel2go']['profile_connected'] ? 'Reconnect Parcel2Go account' : 'Connect Parcel2Go account' }}</button></form>@endif @if($integrations['parcel2go']['profile_client_configured'])<form method="post" action="{{ route('parcel2go.connect') }}">@csrf<button class="rounded-xl border border-brand/40 px-4 py-2 font-semibold text-brand hover:bg-brand/10">{{ $integrations['parcel2go']['profile_connected'] ? 'Reconnect Parcel2Go account' : 'Connect Parcel2Go account' }}</button></form>@endif
</div> </div>
</section> </section>
+1 -1
View File
@@ -36,7 +36,7 @@ class Parcel2GoOAuthTest extends TestCase
$this->assertSame('https://auth.example.test/connect/authorize', strtok($response->headers->get('Location'), '?')); $this->assertSame('https://auth.example.test/connect/authorize', strtok($response->headers->get('Location'), '?'));
$this->assertSame('profile-client', $query['client_id']); $this->assertSame('profile-client', $query['client_id']);
$this->assertSame(route('parcel2go.callback'), $query['redirect_uri']); $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('S256', $query['code_challenge_method']);
$this->assertSame($pending['state'], $query['state']); $this->assertSame($pending['state'], $query['state']);
$this->assertSame(rtrim(strtr(base64_encode(hash('sha256', $pending['verifier'], true)), '+/', '-_'), '='), $query['code_challenge']); $this->assertSame(rtrim(strtr(base64_encode(hash('sha256', $pending['verifier'], true)), '+/', '-_'), '='), $query['code_challenge']);