File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,7 @@ public function getHexColor(): ?string
118118
119119 public function isEnabled (): bool
120120 {
121- $ id = Str::upper ($ this ->getId ());
122-
123- return env ("OAUTH_ {$ id }_ENABLED " , false );
121+ return env ($ this ->getConfigKey (), false );
124122 }
125123
126124 public function shouldCreateMissingUser (OAuthUser $ user ): bool
Original file line number Diff line number Diff line change @@ -563,26 +563,25 @@ private function oauthSettings(): array
563563
564564 $ oauthSchemas = $ this ->oauthService ->getAll ();
565565 foreach ($ oauthSchemas as $ schema ) {
566- $ id = Str::upper ($ schema ->getId ());
567566 $ key = $ schema ->getConfigKey ();
568567
569568 $ formFields [] = Section::make ($ schema ->getName ())
570569 ->columns (5 )
571570 ->icon ($ schema ->getIcon () ?? 'tabler-brand-oauth ' )
572- ->collapsed (fn () => !env ( $ key , false ))
571+ ->collapsed (fn () => !$ schema -> isEnabled ( ))
573572 ->collapsible ()
574573 ->schema ([
575574 Hidden::make ($ key )
576575 ->live ()
577- ->default (env ( $ key )),
576+ ->default ($ schema -> isEnabled ( )),
578577 Actions::make ([
579- Action::make (" disable_oauth_ $ id " )
578+ Action::make (' disable_oauth_ ' . $ schema -> getId () )
580579 ->visible (fn (Get $ get ) => $ get ($ key ))
581580 ->disabled (fn () => !user ()?->can('update settings ' ))
582581 ->label (trans ('admin/setting.oauth.disable ' ))
583582 ->color ('danger ' )
584583 ->action (fn (Set $ set ) => $ set ($ key , false )),
585- Action::make (" enable_oauth_ $ id " )
584+ Action::make (' enable_oauth_ ' . $ schema -> getId () )
586585 ->visible (fn (Get $ get ) => !$ get ($ key ))
587586 ->disabled (fn () => !user ()?->can('update settings ' ))
588587 ->label (trans ('admin/setting.oauth.enable ' ))
You can’t perform that action at this time.
0 commit comments