File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
src/Authentication/Actions Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 44
55use CodeIgniter \HTTP \IncomingRequest ;
66use CodeIgniter \HTTP \RedirectResponse ;
7+ use CodeIgniter \Shield \Authentication \Authenticators \Session ;
78use CodeIgniter \Shield \Exceptions \RuntimeException ;
89use CodeIgniter \Shield \Models \UserIdentityModel ;
910
@@ -96,8 +97,11 @@ public function verify(IncomingRequest $request)
9697 {
9798 $ token = $ request ->getPost ('token ' );
9899
100+ /** @var Session $authenticator */
101+ $ authenticator = auth ('session ' )->getAuthenticator ();
102+
99103 // Token mismatch? Let them try again...
100- if (! auth () ->checkAction ('email_2fa ' , $ token )) {
104+ if (! $ authenticator ->checkAction ('email_2fa ' , $ token )) {
101105 session ()->setFlashdata ('error ' , lang ('Auth.invalid2FAToken ' ));
102106
103107 return view (setting ('Auth.views ' )['action_email_2fa_verify ' ]);
Original file line number Diff line number Diff line change 55use CodeIgniter \Exceptions \PageNotFoundException ;
66use CodeIgniter \HTTP \IncomingRequest ;
77use CodeIgniter \HTTP \RedirectResponse ;
8+ use CodeIgniter \Shield \Authentication \Authenticators \Session ;
89use CodeIgniter \Shield \Entities \User ;
910use CodeIgniter \Shield \Exceptions \LogicException ;
1011use CodeIgniter \Shield \Exceptions \RuntimeException ;
@@ -84,18 +85,23 @@ public function verify(IncomingRequest $request)
8485 {
8586 $ token = $ request ->getVar ('token ' );
8687
88+ $ auth = auth ('session ' );
89+
90+ /** @var Session $authenticator */
91+ $ authenticator = $ auth ->getAuthenticator ();
92+
8793 // No match - let them try again.
88- if (! auth () ->checkAction ('email_activate ' , $ token )) {
94+ if (! $ authenticator ->checkAction ('email_activate ' , $ token )) {
8995 session ()->setFlashdata ('error ' , lang ('Auth.invalidActivateToken ' ));
9096
9197 return view (setting ('Auth.views ' )['action_email_activate_show ' ]);
9298 }
9399
94100 /** @var User $user */
95- $ user = auth () ->user ();
101+ $ user = $ auth ->user ();
96102
97103 // Set the user active now
98- auth () ->activateUser ($ user );
104+ $ auth ->activateUser ($ user );
99105
100106 // Get our login redirect url
101107 return redirect ()->to (config ('Auth ' )->loginRedirect ());
You can’t perform that action at this time.
0 commit comments