8
8
use CodeIgniter \HTTP \RedirectResponse ;
9
9
use CodeIgniter \Shield \Authentication \Authenticators \Session ;
10
10
use CodeIgniter \Shield \Authentication \Passwords ;
11
+ use CodeIgniter \Shield \Config \Auth ;
12
+ use CodeIgniter \Shield \Config \AuthSession ;
11
13
use CodeIgniter \Shield \Traits \Viewable ;
12
14
13
15
class LoginController extends BaseController
@@ -24,7 +26,7 @@ class LoginController extends BaseController
24
26
public function loginView ()
25
27
{
26
28
if (auth ()->loggedIn ()) {
27
- return redirect ()->to (config (' Auth ' )->loginRedirect ());
29
+ return redirect ()->to (config (Auth::class )->loginRedirect ());
28
30
}
29
31
30
32
/** @var Session $authenticator */
@@ -71,7 +73,7 @@ public function loginAction(): RedirectResponse
71
73
return redirect ()->route ('auth-action-show ' )->withCookies ();
72
74
}
73
75
74
- return redirect ()->to (config (' Auth ' )->loginRedirect ())->withCookies ();
76
+ return redirect ()->to (config (Auth::class )->loginRedirect ())->withCookies ();
75
77
}
76
78
77
79
/**
@@ -85,11 +87,11 @@ protected function getValidationRules(): array
85
87
return setting ('Validation.login ' ) ?? [
86
88
// 'username' => [
87
89
// 'label' => 'Auth.username',
88
- // 'rules' => config(' AuthSession' )->usernameValidationRules,
90
+ // 'rules' => config(AuthSession::class )->usernameValidationRules,
89
91
// ],
90
92
'email ' => [
91
93
'label ' => 'Auth.email ' ,
92
- 'rules ' => config (' AuthSession ' )->emailValidationRules ,
94
+ 'rules ' => config (AuthSession::class )->emailValidationRules ,
93
95
],
94
96
'password ' => [
95
97
'label ' => 'Auth.password ' ,
@@ -108,7 +110,7 @@ public function logoutAction(): RedirectResponse
108
110
{
109
111
// Capture logout redirect URL before auth logout,
110
112
// otherwise you cannot check the user in `logoutRedirect()`.
111
- $ url = config (' Auth ' )->logoutRedirect ();
113
+ $ url = config (Auth::class )->logoutRedirect ();
112
114
113
115
auth ()->logout ();
114
116
0 commit comments