Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use plain Bearer auth for legacy sessions instead of DPoP

+9 -1
+9 -1
src/Http/HasHttp.php
··· 3 3 namespace SocialDept\AtpClient\Http; 4 4 5 5 use Illuminate\Http\Client\Response as LaravelResponse; 6 + use Illuminate\Support\Facades\Http; 6 7 use InvalidArgumentException; 7 8 use SocialDept\AtpClient\Exceptions\ValidationException; 8 9 use SocialDept\AtpClient\Session\Session; ··· 48 49 } 49 50 50 51 /** 51 - * Build authenticated request with DPoP proof and automatic nonce retry 52 + * Build authenticated request. 53 + * 54 + * OAuth sessions use DPoP proof with Bearer token. 55 + * Legacy sessions use plain Bearer token. 52 56 */ 53 57 protected function buildAuthenticatedRequest( 54 58 Session $session, 55 59 string $url, 56 60 string $method 57 61 ): \Illuminate\Http\Client\PendingRequest { 62 + if ($session->isLegacy()) { 63 + return Http::withHeader('Authorization', 'Bearer '.$session->accessToken()); 64 + } 65 + 58 66 return $this->dpopClient->request( 59 67 pdsEndpoint: $session->pdsEndpoint(), 60 68 url: $url,