Skip to content

Commit

Permalink
bug #812 [make:auth] fix user email field with capital E (jrushlow)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

[make:auth] fix user email field with capital `E`

We were using the wrong `Str` camel case method to generate the username field variable for the authenticator template.

```diff
// class ACustomAuthenticator extends AbstractLoginFormAuthenticator

...

public function authenticate(Request $request): PassportInterface
{
- $Email = $request->request->get('email', '');
+ $email = $request->request->get('email', '');

...
}
```

Commits
-------

8695026 lets use the correct camel case
  • Loading branch information
weaverryan committed Feb 10, 2021
2 parents 9a9e3f4 + 8695026 commit 313b566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Maker/MakeAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private function generateAuthenticatorClass(array $securityData, string $authent
'user_class_name' => $userClassNameDetails->getShortName(),
'username_field' => $userNameField,
'username_field_label' => Str::asHumanWords($userNameField),
'username_field_var' => Str::asCamelCase($userNameField),
'username_field_var' => Str::asLowerCamelCase($userNameField),
'user_needs_encoder' => $this->userClassHasEncoder($securityData, $userClass),
'user_is_entity' => $this->doctrineHelper->isClassAMappedEntity($userClass),
'provider_key_type_hint' => $this->providerKeyTypeHint(),
Expand Down

0 comments on commit 313b566

Please sign in to comment.