File tree Expand file tree Collapse file tree
tests/TestCase/Authenticator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ It also helps to avoid session invalidation.
3737Session itself stores the entity object including nested objects like DateTime or enums.
3838With only the ID stored, the invalidation due to objects being modified will also dissolve.
3939
40- Make sure to match this with a Token identifier with ``id `` keys:
40+ Make sure to match this with a Token identifier with ``key ``/`` id `` keys:
4141
4242 $service->loadIdentifier('Authentication.Token', [
43- 'tokenField' => 'id',
44- 'dataField' => 'id',
43+ 'tokenField' => 'id', // lookup for DB table
44+ 'dataField' => 'key', // incoming data
4545 'resolver' => 'Authentication.Orm',
4646 ]);
4747
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ class PrimaryKeySessionAuthenticator extends SessionAuthenticator
1818 * @param \Authentication\Identifier\IdentifierInterface $identifier
1919 * @param array<string, mixed> $config
2020 */
21- public function __construct (IdentifierInterface $ identifier , array $ config = []) {
21+ public function __construct (IdentifierInterface $ identifier , array $ config = [])
22+ {
2223 $ config += [
23- 'identifierKey ' => 'id ' ,
24+ 'identifierKey ' => 'key ' ,
2425 ];
2526
2627 parent ::__construct ($ identifier , $ config );
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ public function testAuthenticateSuccess()
8484 $ this ->identifiers = new IdentifierCollection ([
8585 'Authentication.Token ' => [
8686 'tokenField ' => 'id ' ,
87- 'dataField ' => 'id ' ,
87+ 'dataField ' => 'key ' ,
8888 'resolver ' => [
8989 'className ' => 'Authentication.Orm ' ,
9090 'userModel ' => 'AuthUsers ' ,
@@ -121,7 +121,7 @@ public function testAuthenticateSuccessCustomFinder()
121121 $ this ->identifiers = new IdentifierCollection ([
122122 'Authentication.Token ' => [
123123 'tokenField ' => 'id ' ,
124- 'dataField ' => 'id ' ,
124+ 'dataField ' => 'key ' ,
125125 'resolver ' => [
126126 'className ' => 'Authentication.Orm ' ,
127127 'userModel ' => 'AuthUsers ' ,
You can’t perform that action at this time.
0 commit comments