key($did)); } public function storeCredentials(string $did, AccessToken $token): void { Session::put($this->key($did), $this->toCredentials($token)); } public function updateCredentials(string $did, AccessToken $token): void { $this->storeCredentials($did, $token); } public function removeCredentials(string $did): void { Session::forget($this->key($did)); } protected function key(string $did): string { return $this->prefix.$did; } protected function toCredentials(AccessToken $token): Credentials { return new Credentials( did: $token->did, accessToken: $token->accessJwt, refreshToken: $token->refreshJwt, expiresAt: $token->expiresAt, handle: $token->handle, issuer: $token->issuer, scope: $token->scope, authType: $token->authType, ); } }