mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix OAuthProvider
& Add ColorPicker
for Authentik
(#975)
* Fix driver name * Fix AuthentikProvider config & Add ColorPicker * Add sqlite-journal to .gitignore
This commit is contained in:
parent
77bf70b063
commit
9ec2f6eae1
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,6 +23,7 @@ yarn-error.log
|
|||||||
|
|
||||||
public/assets/manifest.json
|
public/assets/manifest.json
|
||||||
/database/*.sqlite
|
/database/*.sqlite
|
||||||
|
/database/*.sqlite-journal
|
||||||
filament-monaco-editor/
|
filament-monaco-editor/
|
||||||
_ide_helper*
|
_ide_helper*
|
||||||
/.phpstorm.meta.php
|
/.phpstorm.meta.php
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Extensions\OAuth\Providers;
|
namespace App\Extensions\OAuth\Providers;
|
||||||
|
|
||||||
|
use Filament\Forms\Components\ColorPicker;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use SocialiteProviders\Authentik\Provider;
|
use SocialiteProviders\Authentik\Provider;
|
||||||
|
|
||||||
@ -20,11 +21,9 @@ final class AuthentikProvider extends OAuthProvider
|
|||||||
public function getServiceConfig(): array
|
public function getServiceConfig(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'client_id' => null,
|
'base_url' => env('OAUTH_AUTHENTIK_BASE_URL'),
|
||||||
'client_secret' => env('OAUTH_STEAM_CLIENT_SECRET'),
|
'client_id' => env('OAUTH_AUTHENTIK_CLIENT_ID'),
|
||||||
'allowed_hosts' => [
|
'client_secret' => env('OAUTH_AUTHENTIK_CLIENT_SECRET'),
|
||||||
str_replace(['http://', 'https://'], '', env('APP_URL')),
|
|
||||||
],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,9 +41,13 @@ final class AuthentikProvider extends OAuthProvider
|
|||||||
TextInput::make('OAUTH_AUTHENTIK_DISPLAY_NAME')
|
TextInput::make('OAUTH_AUTHENTIK_DISPLAY_NAME')
|
||||||
->label('Display Name')
|
->label('Display Name')
|
||||||
->placeholder('Display Name')
|
->placeholder('Display Name')
|
||||||
->columnSpan(2)
|
|
||||||
->autocomplete(false)
|
->autocomplete(false)
|
||||||
->default(env('OAUTH_AUTHENTIK_DISPLAY_NAME', 'Authentik')),
|
->default(env('OAUTH_AUTHENTIK_DISPLAY_NAME', 'Authentik')),
|
||||||
|
ColorPicker::make('OAUTH_AUTHENTIK_DISPLAY_COLOR')
|
||||||
|
->label('Display Color')
|
||||||
|
->placeholder('#fd4b2d')
|
||||||
|
->default(env('OAUTH_AUTHENTIK_DISPLAY_COLOR', '#fd4b2d'))
|
||||||
|
->hex(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +58,7 @@ final class AuthentikProvider extends OAuthProvider
|
|||||||
|
|
||||||
public function getHexColor(): string
|
public function getHexColor(): string
|
||||||
{
|
{
|
||||||
return '#fd4b2d';
|
return env('OAUTH_AUTHENTIK_DISPLAY_COLOR') ?? '#fd4b2d';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function register(): self
|
public static function register(): self
|
||||||
|
@ -17,7 +17,7 @@ final class DiscordProvider extends OAuthProvider
|
|||||||
return 'discord';
|
return 'discord';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getProvider(): string
|
public function getProviderClass(): string
|
||||||
{
|
{
|
||||||
return Provider::class;
|
return Provider::class;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ class EditProfile extends BaseEditProfile
|
|||||||
->success()
|
->success()
|
||||||
->send();
|
->send();
|
||||||
} else {
|
} else {
|
||||||
redirect(Socialite::with($name)->redirect()->getTargetUrl());
|
redirect(Socialite::with($id)->redirect()->getTargetUrl());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user