mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-14 22:26:14 +00:00
refactored code
Signed-off-by: Maurice Preuß (envoyr) <hello@envoyr.com>
This commit is contained in:
30
src/Id/Concerns/ManagesProfile.php
Normal file
30
src/Id/Concerns/ManagesProfile.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\Concerns;
|
||||
|
||||
use Anikeen\Id\ApiOperations\Request;
|
||||
use Anikeen\Id\Exceptions\RequestRequiresClientIdException;
|
||||
use Anikeen\Id\Result;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
trait ManagesProfile
|
||||
{
|
||||
use Request;
|
||||
|
||||
/**
|
||||
* Get the profile url for the current user.
|
||||
*
|
||||
* @param string|null $returnUrl The URL to redirect to after the user has completed their profile.
|
||||
* @param array $options Additional options for the profile URL.
|
||||
* @return string
|
||||
* @throws GuzzleException
|
||||
* @throws RequestRequiresClientIdException
|
||||
*/
|
||||
public function profilePortalUrl(?string $returnUrl = null, array $options = []): string
|
||||
{
|
||||
return $this->request('POST', 'v1/user/profile', [
|
||||
'return_url' => $returnUrl,
|
||||
'options' => $options,
|
||||
])->data->url;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user