Skip to content

Commit

Permalink
Fixed loggin with a capitalised email address when using old users [g…
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Sep 5, 2022
1 parent 3f10c05 commit f799a71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
1. [](#new)
* Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object
* Added support for `flex-ignore@` to hide all the nested fields in the blueprint
1. [](#bugfix)
* Fixed loggin with a capitalised email address when using old users [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229)

# v1.7.35
## 08/04/2022
Expand Down
3 changes: 2 additions & 1 deletion system/src/Grav/Common/User/DataUser/UserCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ public function find($query, $fields = ['username', 'email']): UserInterface

// If not found, try the fields
if (!$user->exists()) {
$query = mb_strtolower($query);
foreach ($files as $file) {
if (Utils::endsWith($file, YAML_EXT)) {
$find_user = $this->load(trim(Utils::pathinfo($file, PATHINFO_FILENAME)));
foreach ($fields as $field) {
if (isset($find_user[$field]) && $find_user[$field] === $query) {
if (isset($find_user[$field]) && mb_strtolower($find_user[$field]) === $query) {
return $find_user;
}
}
Expand Down

0 comments on commit f799a71

Please sign in to comment.