Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

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

Rename token refresh events to be auth-type agnostic

+7 -6
+1 -1
src/Events/OAuthTokenRefreshed.php src/Events/TokenRefreshed.php
··· 7 7 use SocialDept\AtpClient\Data\AccessToken; 8 8 use SocialDept\AtpClient\Session\Session; 9 9 10 - class OAuthTokenRefreshed 10 + class TokenRefreshed 11 11 { 12 12 use Dispatchable, SerializesModels; 13 13
+1 -1
src/Events/OAuthTokenRefreshing.php src/Events/TokenRefreshing.php
··· 6 6 use Illuminate\Queue\SerializesModels; 7 7 use SocialDept\AtpClient\Session\Session; 8 8 9 - class OAuthTokenRefreshing 9 + class TokenRefreshing 10 10 { 11 11 use Dispatchable, SerializesModels; 12 12
+5 -4
src/Session/SessionManager.php
··· 8 8 use SocialDept\AtpClient\Contracts\CredentialProvider; 9 9 use SocialDept\AtpClient\Contracts\KeyStore; 10 10 use SocialDept\AtpClient\Data\AccessToken; 11 - use SocialDept\AtpClient\Events\OAuthTokenRefreshed; 12 - use SocialDept\AtpClient\Events\OAuthTokenRefreshing; 11 + use SocialDept\AtpClient\Events\TokenRefreshed; 12 + use SocialDept\AtpClient\Events\TokenRefreshing; 13 13 use SocialDept\AtpClient\Exceptions\AuthenticationException; 14 14 use SocialDept\AtpClient\Exceptions\HandleResolutionException; 15 15 use SocialDept\AtpClient\Exceptions\SessionExpiredException; ··· 138 138 $did = $session->did(); 139 139 140 140 // Fire event before refresh (allows developers to invalidate old token) 141 - event(new OAuthTokenRefreshing($session)); 141 + event(new TokenRefreshing($session)); 142 142 143 143 $newToken = $this->refresher->refresh( 144 144 refreshToken: $session->refreshToken(), 145 145 pdsEndpoint: $session->pdsEndpoint(), 146 146 dpopKey: $session->dpopKey(), 147 147 handle: $session->handle(), 148 + authType: $session->authType(), 148 149 ); 149 150 150 151 // Update credentials (CRITICAL: refresh tokens are single-use) 151 152 $this->credentials->updateCredentials($did, $newToken); 152 153 153 154 // Fire event after successful refresh 154 - event(new OAuthTokenRefreshed($session, $newToken)); 155 + event(new TokenRefreshed($session, $newToken)); 155 156 156 157 // Update session 157 158 $newCreds = $this->credentials->getCredentials($did);