Skip to content

Commit 1ed7f15

Browse files
dereuromarkCopilot
andcommitted
Fix remaining identifier doc examples
Follow up the identifier config documentation cleanup by updating the remaining old nested examples and correcting the malformed Authentication.Password example in authenticators.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent df328d0 commit 1ed7f15

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

docs/en/authenticators.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,10 @@ $service = new AuthenticationService();
536536
// Define identifiers
537537
$passwordIdentifier = [
538538
'className' => 'Authentication.Password',
539-
'username' => 'email',
540-
'password' => 'password'
539+
'fields' => [
540+
'username' => 'email',
541+
'password' => 'password',
542+
],
541543
];
542544

543545
// Load the authenticators leaving Basic as the last one.

docs/en/migration-from-the-authcomponent.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,13 @@ You’ll now have to configure it this way:
134134
$service = new AuthenticationService();
135135

136136
// Define identifier
137-
$passwordIdentifier = [
138-
'Authentication.Password' => [
139-
'fields' => [
140-
'username' => 'email',
141-
'password' => 'password'
142-
]
143-
],
144-
];
137+
$passwordIdentifier = [
138+
'className' => 'Authentication.Password',
139+
'fields' => [
140+
'username' => 'email',
141+
'password' => 'password',
142+
],
143+
];
145144

146145
// Load the authenticators. Session should be first.
147146
$service->loadAuthenticator('Authentication.Session');
@@ -159,15 +158,14 @@ $service = new AuthenticationService();
159158

160159
// Define identifier
161160
$passwordIdentifier = [
162-
'Authentication.Password' => [
163-
'resolver' => [
164-
'className' => 'Authentication.Orm',
165-
'userModel' => 'Employees',
166-
],
167-
'fields' => [
168-
'username' => 'email',
169-
'password' => 'password'
170-
]
161+
'className' => 'Authentication.Password',
162+
'resolver' => [
163+
'className' => 'Authentication.Orm',
164+
'userModel' => 'Employees',
165+
],
166+
'fields' => [
167+
'username' => 'email',
168+
'password' => 'password',
171169
],
172170
];
173171
```

docs/en/password-hashers.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,18 @@ fallback hasher as follows:
3838

3939
```php
4040
$passwordIdentifier = [
41-
'Authentication.Password' => [
42-
// Other config options
43-
'passwordHasher' => [
44-
'className' => 'Authentication.Fallback',
45-
'hashers' => [
46-
'Authentication.Default',
47-
[
48-
'className' => 'Authentication.Legacy',
49-
'hashType' => 'md5',
50-
'salt' => false, // turn off default usage of salt
51-
],
52-
]
53-
]
41+
'className' => 'Authentication.Password',
42+
// Other config options
43+
'passwordHasher' => [
44+
'className' => 'Authentication.Fallback',
45+
'hashers' => [
46+
'Authentication.Default',
47+
[
48+
'className' => 'Authentication.Legacy',
49+
'hashType' => 'md5',
50+
'salt' => false, // turn off default usage of salt
51+
],
52+
],
5453
],
5554
];
5655
```

0 commit comments

Comments
 (0)