Skip to content

Commit 0b24a71

Browse files
authored
Merge pull request #8054 from umer936/patch-2
Fix Authentication in Tutorial for Identifier
2 parents d4693ae + a997699 commit 0b24a71

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

en/tutorials-and-examples/cms/authentication.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ Then add the following::
145145
'queryParam' => 'redirect',
146146
]);
147147

148-
// Load identifiers, ensure we check email and password fields
149-
$authenticationService->loadIdentifier('Authentication.Password', [
150-
'fields' => [
151-
'username' => 'email',
152-
'password' => 'password',
153-
],
154-
]);
155-
156148
// Load the authenticators, you want session first
157149
$authenticationService->loadAuthenticator('Authentication.Session');
158150
// Configure form data check to pick email and password
@@ -162,6 +154,14 @@ Then add the following::
162154
'password' => 'password',
163155
],
164156
'loginUrl' => Router::url('/users/login'),
157+
'identifier' => [
158+
'Authentication.Password' => [
159+
'fields' => [
160+
'username' => 'email',
161+
'password' => 'password',
162+
],
163+
],
164+
],
165165
]);
166166

167167
return $authenticationService;

0 commit comments

Comments
 (0)