mirror of
https://github.com/brufdev/many-notes.git
synced 2025-12-30 07:20:59 -06:00
29 lines
602 B
PHP
29 lines
602 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Actions;
|
|
|
|
use App\Enums\OAuthProvider;
|
|
|
|
final readonly class GetOAuthPostLogoutRedirectUri
|
|
{
|
|
public function handle(): string
|
|
{
|
|
$providers = new GetAvailableOAuthProviders()->handle();
|
|
$provider = current($providers);
|
|
|
|
if (!$provider instanceof OAuthProvider) {
|
|
return '';
|
|
}
|
|
|
|
$postLogoutRedirectUri = config("services.$provider->value.post_logout_redirect_uri");
|
|
|
|
if (!is_string($postLogoutRedirectUri)) {
|
|
return '';
|
|
}
|
|
|
|
return $postLogoutRedirectUri;
|
|
}
|
|
}
|