add refresh token method

Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
2025-05-02 07:29:43 +02:00
parent 1d2119a32b
commit 63e3f0a4a2

View File

@@ -46,6 +46,20 @@ trait ManagesUsers
return $this->post('v1/users', $attributes); return $this->post('v1/users', $attributes);
} }
/**
* Refreshes the access token using the refresh token.
*/
public function refreshToken(string $storedRefreshToken, string $scope = ''): Result
{
return $this->post('../oauth/token', [
'grant_type' => 'refresh_token',
'refresh_token' => $storedRefreshToken,
'client_id' => $this->clientId,
'client_secret' => $this->clientSecret,
'scope' => $scope,
]);
}
/** /**
* Checks if the given email exists. * Checks if the given email exists.
* *