88use CodeIgniter \HTTP \RedirectResponse ;
99use CodeIgniter \Shield \Authentication \Authenticators \Session ;
1010use CodeIgniter \Shield \Authentication \Passwords ;
11+ use CodeIgniter \Shield \Config \Auth ;
12+ use CodeIgniter \Shield \Config \AuthSession ;
1113use CodeIgniter \Shield \Traits \Viewable ;
1214
1315class LoginController extends BaseController
@@ -24,7 +26,7 @@ class LoginController extends BaseController
2426 public function loginView ()
2527 {
2628 if (auth ()->loggedIn ()) {
27- return redirect ()->to (config (' Auth ' )->loginRedirect ());
29+ return redirect ()->to (config (Auth::class )->loginRedirect ());
2830 }
2931
3032 /** @var Session $authenticator */
@@ -71,7 +73,7 @@ public function loginAction(): RedirectResponse
7173 return redirect ()->route ('auth-action-show ' )->withCookies ();
7274 }
7375
74- return redirect ()->to (config (' Auth ' )->loginRedirect ())->withCookies ();
76+ return redirect ()->to (config (Auth::class )->loginRedirect ())->withCookies ();
7577 }
7678
7779 /**
@@ -85,11 +87,11 @@ protected function getValidationRules(): array
8587 return setting ('Validation.login ' ) ?? [
8688 // 'username' => [
8789 // 'label' => 'Auth.username',
88- // 'rules' => config(' AuthSession' )->usernameValidationRules,
90+ // 'rules' => config(AuthSession::class )->usernameValidationRules,
8991 // ],
9092 'email ' => [
9193 'label ' => 'Auth.email ' ,
92- 'rules ' => config (' AuthSession ' )->emailValidationRules ,
94+ 'rules ' => config (AuthSession::class )->emailValidationRules ,
9395 ],
9496 'password ' => [
9597 'label ' => 'Auth.password ' ,
@@ -108,7 +110,7 @@ public function logoutAction(): RedirectResponse
108110 {
109111 // Capture logout redirect URL before auth logout,
110112 // otherwise you cannot check the user in `logoutRedirect()`.
111- $ url = config (' Auth ' )->logoutRedirect ();
113+ $ url = config (Auth::class )->logoutRedirect ();
112114
113115 auth ()->logout ();
114116
0 commit comments