File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,15 @@ public function shutdown(EventInterface $event): void {
103103 $ data ['config ' ] = $ authUserComponent ->getConfig ();
104104 $ data ['access ' ] = $ access ;
105105
106- $ data ['identity ' ] = $ request ->getAttribute ('identity ' );
106+ $ identity = $ request ->getAttribute ('identity ' );
107+ // Store as array to avoid serialization issues with PDO/ORM connections
108+ $ data ['identity ' ] = $ identity ? $ identity ->getOriginalData () : null ;
109+ $ data ['identityClass ' ] = $ identity ? get_class ($ identity ) : null ;
107110
108111 /** @var \Authentication\AuthenticationService|null $auth */
109112 $ auth = $ request ->getAttribute ('authentication ' );
110- $ data ['authenticationProvider ' ] = $ auth ? $ auth ->getAuthenticationProvider () : null ;
111- $ data ['identificationProvider ' ] = $ auth ? $ auth ->getIdentificationProvider () : null ;
113+ $ data ['authenticationProvider ' ] = $ auth?->getAuthenticationProvider() ? get_class ( $ auth ->getAuthenticationProvider () ) : null ;
114+ $ data ['identificationProvider ' ] = $ auth?->getIdentificationProvider() ? get_class ( $ auth ->getIdentificationProvider () ) : null ;
112115
113116 $ this ->_data = $ data ;
114117 }
Original file line number Diff line number Diff line change 99 * @var bool[] $access
1010 * @var string $path;
1111 * @var array<string, mixed> $config
12- * @var \Authorization\Identity|\Authentication\Identity|null $identity
13- * @var \Authentication\Authenticator\AuthenticatorInterface|null $authenticationProvider
14- * @var \Authentication\Identifier\IdentifierInterface|null $identificationProvider
12+ * @var array|null $identity
13+ * @var string|null $identityClass
14+ * @var string|null $authenticationProvider
15+ * @var string|null $identificationProvider
1516 */
1617
1718use Cake \Error \Debugger ;
6768
6869 <?php if ($ authenticationProvider ) {
6970 echo '<p> ' ;
70- echo 'Authentication provider used: ' . get_class ($ authenticationProvider );
71+ echo 'Authentication provider used: ' . h ($ authenticationProvider );
7172 echo '</p> ' ;
7273 } ?>
7374 <?php if ($ identificationProvider ) {
7475 echo '<p> ' ;
75- echo 'Identification provider used: ' . get_class ($ identificationProvider );
76+ echo 'Identification provider used: ' . h ($ identificationProvider );
7677 echo '</p> ' ;
7778 } ?>
7879
128129 <?php if ($ identity ) { ?>
129130 <h2>Identity</h2>
130131 <?php
131- echo '<h4> ' . get_class ($ identity ) . '</h4> ' ;
132+ if (!empty ($ identityClass )) {
133+ echo '<h4> ' . h ($ identityClass ) . '</h4> ' ;
134+ }
132135 ?>
133136
134137 <?php
135- $ user = $ identity ->getOriginalData ();
136- echo Debugger::exportVar ($ user );
138+ echo Debugger::exportVar ($ identity );
137139 ?>
138140 <?php } ?>
139141
You can’t perform that action at this time.
0 commit comments