fix: update OauthSettingSeeder to handle new provider definitions and ensure authentik is recreated if missing
This commit is contained in:
parent
8a195c8cfb
commit
a80d17e097
1 changed files with 6 additions and 2 deletions
|
|
@ -22,9 +22,13 @@ public function run(): void
|
|||
]);
|
||||
|
||||
$isOauthSeeded = OauthSetting::count() > 0;
|
||||
$isOauthWithZeroId = OauthSetting::where('id', 0)->exists();
|
||||
|
||||
// We changed how providers are defined in the database, so we authentik does not exists, we need to recreate all of the auth providers
|
||||
// Before authentik was a provider, providers started with 0 id
|
||||
|
||||
$isOauthAuthentik = OauthSetting::where('provider', 'authentik')->exists();
|
||||
if ($isOauthSeeded) {
|
||||
if ($isOauthWithZeroId) {
|
||||
if (! $isOauthAuthentik) {
|
||||
$allProviders = OauthSetting::all();
|
||||
$notFoundProviders = $providers->diff($allProviders->pluck('provider'));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue