diff --git a/app/Extensions/OAuth/Providers/DiscordProvider.php b/app/Extensions/OAuth/Providers/DiscordProvider.php index fd2392d92..5981172f9 100644 --- a/app/Extensions/OAuth/Providers/DiscordProvider.php +++ b/app/Extensions/OAuth/Providers/DiscordProvider.php @@ -6,8 +6,8 @@ use Filament\Forms\Components\Placeholder; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Wizard\Step; use Illuminate\Foundation\Application; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; -use Illuminate\Support\Str; use SocialiteProviders\Discord\Provider; use Webbingbrasil\FilamentCopyActions\Forms\Actions\CopyAction; @@ -34,15 +34,15 @@ final class DiscordProvider extends OAuthProvider Step::make('Register new Discord OAuth App') ->schema([ Placeholder::make('') - ->content(new HtmlString('

Visit the Discord Developer Portal and click on New Application. Enter a Name (e.g. your panel name) and click on Create.

Copy the Client ID and the Client Secret, you will need them in the final step.

')), + ->content(new HtmlString(Blade::render('

Visit the Discord Developer Portal and click on New Application. Enter a Name (e.g. your panel name) and click on Create.

Copy the Client ID and the Client Secret from the OAuth2 tab, you will need them in the final step.

'))), Placeholder::make('') ->content(new HtmlString('

Under Redirects add the below URL.

')), TextInput::make('_noenv_callback') ->label('Redirect URL') ->dehydrated() ->disabled() - ->hintAction(fn () => request()->isSecure() ? CopyAction::make() : null) - ->formatStateUsing(fn () => config('app.url') . (Str::endsWith(config('app.url'), '/') ? '' : '/') . 'auth/oauth/callback/discord'), + ->hintAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null) + ->formatStateUsing(fn () => url('/auth/oauth/callback/discord')), ]), ], parent::getSetupSteps()); } diff --git a/app/Extensions/OAuth/Providers/GithubProvider.php b/app/Extensions/OAuth/Providers/GithubProvider.php index bbf98f8a3..e0190e882 100644 --- a/app/Extensions/OAuth/Providers/GithubProvider.php +++ b/app/Extensions/OAuth/Providers/GithubProvider.php @@ -6,8 +6,8 @@ use Filament\Forms\Components\Placeholder; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Wizard\Step; use Illuminate\Foundation\Application; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; -use Illuminate\Support\Str; use Webbingbrasil\FilamentCopyActions\Forms\Actions\CopyAction; final class GithubProvider extends OAuthProvider @@ -28,13 +28,13 @@ final class GithubProvider extends OAuthProvider Step::make('Register new Github OAuth App') ->schema([ Placeholder::make('') - ->content(new HtmlString('

Visit the Github Developer Dashboard, go to OAuth Apps and click on New OAuth App.

Enter an Application name (e.g. your panel name), set Homepage URL to your panel url and enter the below url as Authorization callback URL.

')), + ->content(new HtmlString(Blade::render('

Visit the Github Developer Dashboard, go to OAuth Apps and click on New OAuth App.

Enter an Application name (e.g. your panel name), set Homepage URL to your panel url and enter the below url as Authorization callback URL.

'))), TextInput::make('_noenv_callback') ->label('Authorization callback URL') ->dehydrated() ->disabled() - ->hintAction(fn () => request()->isSecure() ? CopyAction::make() : null) - ->default(fn () => config('app.url') . (Str::endsWith(config('app.url'), '/') ? '' : '/') . 'auth/oauth/callback/github'), + ->hintAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null) + ->default(fn () => url('/auth/oauth/callback/github')), Placeholder::make('') ->content(new HtmlString('

When you filled all fields click on Register application.

')), ]), diff --git a/app/Extensions/OAuth/Providers/GitlabProvider.php b/app/Extensions/OAuth/Providers/GitlabProvider.php index 71a497ad0..25b9a4855 100644 --- a/app/Extensions/OAuth/Providers/GitlabProvider.php +++ b/app/Extensions/OAuth/Providers/GitlabProvider.php @@ -8,7 +8,6 @@ use Filament\Forms\Components\Wizard\Step; use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; -use Illuminate\Support\Str; use Webbingbrasil\FilamentCopyActions\Forms\Actions\CopyAction; final class GitlabProvider extends OAuthProvider @@ -54,8 +53,8 @@ final class GitlabProvider extends OAuthProvider ->label('Redirect URI') ->dehydrated() ->disabled() - ->hintAction(fn () => request()->isSecure() ? CopyAction::make() : null) - ->default(fn () => config('app.url') . (Str::endsWith(config('app.url'), '/') ? '' : '/') . 'auth/oauth/callback/gitlab'), + ->hintAction(fn (string $state) => request()->isSecure() ? CopyAction::make()->copyable($state) : null) + ->default(fn () => url('/auth/oauth/callback/gitlab')), ]), ], parent::getSetupSteps()); } diff --git a/app/Extensions/OAuth/Providers/SteamProvider.php b/app/Extensions/OAuth/Providers/SteamProvider.php index 34787a43b..85e61ee1b 100644 --- a/app/Extensions/OAuth/Providers/SteamProvider.php +++ b/app/Extensions/OAuth/Providers/SteamProvider.php @@ -6,6 +6,7 @@ use Filament\Forms\Components\Placeholder; use Filament\Forms\Components\TextInput; use Filament\Forms\Components\Wizard\Step; use Illuminate\Foundation\Application; +use Illuminate\Support\Facades\Blade; use Illuminate\Support\HtmlString; use SocialiteProviders\Steam\Provider; @@ -58,7 +59,7 @@ final class SteamProvider extends OAuthProvider Step::make('Create API Key') ->schema([ Placeholder::make('') - ->content(new HtmlString('Visit https://steamcommunity.com/dev/apikey to generate an API key.')), + ->content(new HtmlString(Blade::render('Visit https://steamcommunity.com/dev/apikey to generate an API key.'))), ]), ], parent::getSetupSteps()); }