You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user requests to reset their password, the plugin needs to find their account. By default, it searches using both the `username` and `email` fields.
246
+
You can customize which fields are used for this lookup by configuring the `Users.PasswordReset.findWith` setting in your `config/users.php` file.
247
+
248
+
The value should be an array of column names that exist in your `users` table. The system will dynamically build a query to search using these fields.
249
+
250
+
For example, if your application only uses email for identification, you can restrict the search to just the `email` column to avoid errors and improve performance:
251
+
252
+
```php
253
+
// in config/users.php
254
+
'Users' => [
255
+
'PasswordReset' => [
256
+
'findWith' => ['email']
257
+
],
258
+
]
259
+
```
260
+
261
+
If you need to search by `username` and another custom field, you could configure it like this:
Copy file name to clipboardExpand all lines: phpstan-baseline.neon
-5Lines changed: 0 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -110,11 +110,6 @@ parameters:
110
110
count:1
111
111
path:src/Model/Behavior/LinkSocialBehavior.php
112
112
113
-
-
114
-
message:"#^Call to an undefined method Cake\\\\ORM\\\\Table\\:\\:findByUsernameOrEmail\\(\\)\\.$#"
115
-
count:1
116
-
path:src/Model/Behavior/PasswordBehavior.php
117
-
118
113
-
119
114
message:"#^Method CakeDC\\\\Users\\\\Model\\\\Behavior\\\\PasswordBehavior\\:\\:resetToken\\(\\) should return string but returns Cake\\\\Datasource\\\\EntityInterface\\|false\\.$#"
0 commit comments