@@ -219,7 +219,7 @@ public function startUpAction(string $type, User $user): bool
219219 public function getAction (): ?ActionInterface
220220 {
221221 /** @var class-string<ActionInterface>|null $actionClass */
222- $ actionClass = $ this ->getSessionKey ('auth_action ' );
222+ $ actionClass = $ this ->getSessionUserKey ('auth_action ' );
223223
224224 if ($ actionClass === null ) {
225225 return null ;
@@ -249,8 +249,8 @@ public function checkAction(UserIdentity $identity, string $token): bool
249249 $ this ->userIdentityModel ->deleteIdentitiesByType ($ user , $ identity ->type );
250250
251251 // Clean up our session
252- $ this ->removeSessionKey ('auth_action ' );
253- $ this ->removeSessionKey ('auth_action_message ' );
252+ $ this ->removeSessionUserKey ('auth_action ' );
253+ $ this ->removeSessionUserKey ('auth_action_message ' );
254254
255255 $ this ->user = $ user ;
256256
@@ -387,7 +387,7 @@ private function checkUserState(): void
387387 }
388388
389389 /** @var int|string|null $userId */
390- $ userId = $ this ->getSessionKey ('id ' );
390+ $ userId = $ this ->getSessionUserKey ('id ' );
391391
392392 // Has User Info in Session.
393393 if ($ userId !== null ) {
@@ -404,7 +404,7 @@ private function checkUserState(): void
404404 }
405405
406406 // If having `auth_action`, it is pending.
407- if ($ this ->getSessionKey ('auth_action ' )) {
407+ if ($ this ->getSessionUserKey ('auth_action ' )) {
408408 $ this ->userState = self ::STATE_PENDING ;
409409
410410 return ;
@@ -445,15 +445,15 @@ public function hasAction($userId = null): bool
445445 if ($ this ->getIdentitiesForAction ($ user ) !== []) {
446446 // Make pending login state
447447 $ this ->user = $ user ;
448- $ this ->setSessionKey ('id ' , $ user ->id );
448+ $ this ->setSessionUserKey ('id ' , $ user ->id );
449449 $ this ->setAuthAction ();
450450
451451 return true ;
452452 }
453453 }
454454
455455 // Check the Session
456- if ($ this ->getSessionKey ('auth_action ' )) {
456+ if ($ this ->getSessionUserKey ('auth_action ' )) {
457457 return true ;
458458 }
459459
@@ -488,8 +488,8 @@ private function setAuthAction(): bool
488488 if ($ identity instanceof UserIdentity) {
489489 $ this ->userState = self ::STATE_PENDING ;
490490
491- $ this ->setSessionKey ('auth_action ' , $ actionClass );
492- $ this ->setSessionKey ('auth_action_message ' , $ identity ->extra );
491+ $ this ->setSessionUserKey ('auth_action ' , $ actionClass );
492+ $ this ->setSessionUserKey ('auth_action_message ' , $ identity ->extra );
493493
494494 return true ;
495495 }
@@ -561,7 +561,7 @@ public function getPendingMessage(): string
561561 {
562562 $ this ->checkUserState ();
563563
564- return $ this ->getSessionKey ('auth_action_message ' ) ?? '' ;
564+ return $ this ->getSessionUserKey ('auth_action_message ' ) ?? '' ;
565565 }
566566
567567 /**
@@ -644,7 +644,7 @@ private function checkRememberMeToken(string $remember)
644644 public function startLogin (User $ user ): void
645645 {
646646 /** @var int|string|null $userId */
647- $ userId = $ this ->getSessionKey ('id ' );
647+ $ userId = $ this ->getSessionUserKey ('id ' );
648648
649649 // Check if already logged in.
650650 if ($ userId !== null ) {
@@ -668,7 +668,7 @@ public function startLogin(User $user): void
668668 }
669669
670670 // Let the session know we're logged in
671- $ this ->setSessionKey ('id ' , $ user ->id );
671+ $ this ->setSessionUserKey ('id ' , $ user ->id );
672672
673673 /** @var Response $response */
674674 $ response = service ('response ' );
@@ -698,7 +698,7 @@ protected function removeSessionUserInfo(): void
698698 *
699699 * @return int|string|null
700700 */
701- protected function getSessionKey (string $ key )
701+ protected function getSessionUserKey (string $ key )
702702 {
703703 $ sessionUserInfo = $ this ->getSessionUserInfo ();
704704
@@ -710,7 +710,7 @@ protected function getSessionKey(string $key)
710710 *
711711 * @param int|string|null $value
712712 */
713- protected function setSessionKey (string $ key , $ value ): void
713+ protected function setSessionUserKey (string $ key , $ value ): void
714714 {
715715 $ sessionUserInfo = $ this ->getSessionUserInfo ();
716716 $ sessionUserInfo [$ key ] = $ value ;
@@ -720,7 +720,7 @@ protected function setSessionKey(string $key, $value): void
720720 /**
721721 * Remove the key value in Session User Info
722722 */
723- protected function removeSessionKey (string $ key ): void
723+ protected function removeSessionUserKey (string $ key ): void
724724 {
725725 $ sessionUserInfo = $ this ->getSessionUserInfo ();
726726 unset($ sessionUserInfo [$ key ]);
@@ -744,7 +744,7 @@ public function login(User $user): void
744744 );
745745 }
746746 // Check auth_action in Session
747- if ($ this ->getSessionKey ('auth_action ' )) {
747+ if ($ this ->getSessionUserKey ('auth_action ' )) {
748748 throw new LogicException (
749749 'The user has auth action in session, so cannot complete login. '
750750 . ' If you want to start to login with auth action, use startLogin() instead. '
0 commit comments