Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
BcUtil::loginUserでプレフィックスを指定しても別のプレフィックスのログイン情報が返却される fix #2111
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuring committed Mar 19, 2023
1 parent 9dd088f commit 7a1bbfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/baser-core/src/Plugin.php
Expand Up @@ -291,7 +291,7 @@ public function getAuthenticationService(ServerRequestInterface $request): Authe

if (!$this->isRequiredAuthentication($authSetting)) {
$service->loadAuthenticator('Authentication.Form');
if (!empty($authSetting['sessionKey'])) {
if (!empty($authSetting['sessionKey']) && empty($authSetting['disabled'])) {
$service->loadAuthenticator('Authentication.Session', [
'sessionKey' => $authSetting['sessionKey'],
]);
Expand Down
4 changes: 2 additions & 2 deletions plugins/baser-core/src/Utility/BcUtil.php
Expand Up @@ -119,7 +119,7 @@ class BcUtil
* - 第一優先:authenticationから取得
* - モデルが BaserCore.Users の場合、ユーザーグループがなかったら取得する
* - 第二優先:現在のリクエストに紐づくセッションから取得
* - 第三優先:上記で取得できない場合、プレフィックスが Front だったの場合に
* - 第三優先:上記で取得できない場合、プレフィックスが Front だった場合に
* 他の領域のログインセッションより取得する。
* 複数のログインセッションにログインしている場合は定義順の降順で最初のログイン情報を取得
*
Expand Down Expand Up @@ -154,7 +154,7 @@ public static function loginUser($prefix = null)
return $user;
}
}

$user = false;
if($prefix === 'Front') {
$user = BcUtil::loginUserFromSession($prefix);
Expand Down

0 comments on commit 7a1bbfb

Please sign in to comment.