Skip to content

Commit

Permalink
fix baserproject#2302 Jwt認証領域でも未認証の場合はCSRFチェックをスキップしない
Browse files Browse the repository at this point in the history
  • Loading branch information
seto1 committed Jun 16, 2023
1 parent bf0919e commit d2c2020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions plugins/baser-core/src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ public function middleware(MiddlewareQueue $middlewareQueue): MiddlewareQueue
if($authenticator) {
// 認証済の際、セッション認証以外はスキップ
if(!$authenticator instanceof SessionAuthenticator) return true;
} else {
// 認証できていない場合、領域がJwt認証前提の場合はスキップ
if($authSetting['type'] === 'Jwt') return true;
}
return false;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ public function test_getController()
$this->assertResponseError();
$this->assertResponseContains('bs-container');

$this->post('/baser/api/admin/baser-core/users/add.json');
$this->get('/baser/api/admin/baser-core/users/index.json');
$this->assertResponseCode(401);

$this->post('/baser/api/admin/baser-core/users/add.json');
$this->assertResponseCode(403);

Configure::write('debug', $debug);
}
}

0 comments on commit d2c2020

Please sign in to comment.