File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Authentication/Actions Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 5
5
use CodeIgniter \Exceptions \PageNotFoundException ;
6
6
use CodeIgniter \HTTP \IncomingRequest ;
7
7
use CodeIgniter \HTTP \RedirectResponse ;
8
+ use CodeIgniter \Shield \Exceptions \LogicException ;
8
9
use CodeIgniter \Shield \Exceptions \RuntimeException ;
9
10
use CodeIgniter \Shield \Models \UserIdentityModel ;
10
11
@@ -23,6 +24,13 @@ public function show(): string
23
24
throw new RuntimeException ('Cannot get the User. ' );
24
25
}
25
26
27
+ $ userEmail = $ user ->getAuthEmail ();
28
+ if ($ userEmail === null ) {
29
+ throw new LogicException (
30
+ 'Email Activation needs user email address. user_id: ' . $ user ->getAuthId ()
31
+ );
32
+ }
33
+
26
34
/** @var UserIdentityModel $identityModel */
27
35
$ identityModel = model (UserIdentityModel::class);
28
36
@@ -44,7 +52,7 @@ public function show(): string
44
52
// Send the email
45
53
helper ('email ' );
46
54
$ return = emailer ()->setFrom (setting ('Email.fromEmail ' ), setting ('Email.fromName ' ) ?? '' )
47
- ->setTo ($ user -> getAuthEmail () )
55
+ ->setTo ($ userEmail )
48
56
->setSubject (lang ('Auth.emailActivateSubject ' ))
49
57
->setMessage (view (setting ('Auth.views ' )['action_email_activate_email ' ], ['code ' => $ code ]))
50
58
->send ();
You can’t perform that action at this time.
0 commit comments