Password resetter not defined error #10341
Replies: 6 comments 1 reply
-
In /vendor/statamic/cms/src/Http/Controllers/ForgotPasswordController.php there's the key function for setting the broker:
That is pulling in the settings in the config file at /config/statamic/users.php, which in mine (and the Statamic default on a clean install) is:
But, looking at the controller, it's expecting to parse an array and find the value for 'web'. The config doesn't have a value for web. So I experimented by changing the config to:
And that resolved the error I've been seeing. Now, I don't think that's the correct actual solution - because that then doesn't allow for changing the broker. I think the broker functions need to be changed in the controllers for ForgotPassword, ResetPassword, and ActivateAccount. Instead of getting the value for 'web', they should get the value for 'resets' or 'activations' |
Beta Was this translation helpful? Give feedback.
-
Hmm, my pull request isn't right. I've closed it and am digging into this issue more. |
Beta Was this translation helpful? Give feedback.
-
So... I've discovered there are three slightly different versions of users.php in play here, confusing the issue... First, the /config/statamic/users.php that gets installed by Statamic CLI is slightly different to the one in the Github repo. These are the lines for setting the reset brokers in the version installed by CLI:
These are the equivalent lines in the Statamic/cms repo 5.x branch:
And then I also hadn't realised that when I added Peak Starter Kit to my existing Statamic installation, it overwrote my Statamic config files with its own, and its user.php cpntains this version:
Which fooled me as being the same as that installed by the CLI for a while, but it has changed 'users' into another 'resets'. So I'm not quite sure why those are all different. I have now changed mine to match what's in the Github repo. I did try that version before, as suggested by Erin, and it didn't work then, but it appears to be working now. I'll check that it's not just caching etc and report back. I'll now:
|
Beta Was this translation helpful? Give feedback.
-
Usually, any However, they can be confusing sometimes to debug.
I've just followed these steps on a fresh install of Statamic and everything seems to be working correctly for me. Did you install Statamic fresh or did you install into an existing Laravel app? 🤔 In case you want to compare my config files vs the ones in your app, I've pushed up the repo.
Yes, the
|
Beta Was this translation helpful? Give feedback.
-
Thanks. Yes, in my case it turned out to be that the Statamic Peak starter kit had its own version of the users.php config, which overwrote my initial file without me knowing, and it had an error in. Once I figured that out I reported it to Rob and he's already fixed it. But also, it did get confusing when trying to troubleshoot, and encountering the different repos for Statamic, with slight differences. The different use cases for statamic/statamic and statamic/cms aren't clear, especially to a newbie. So I'm going to provide a PR for a minor update to the README for each repo to capture a bit of what you explain above and make things clearer for new users, if that's ok. But also, might it help clarity if users,php could show the options with an explanation, like this?
Anyway, apologies for my misunderstanding - and thanks to you and the rest of the Statamic community for helping me eventually figure it out. I hope I can make my newness useful, at least, by highlighting where I get confused and contributing to the docs. |
Beta Was this translation helpful? Give feedback.
-
I've provided those two PRs to suggest README changes at: I hope that's ok, and useful. Please do let me know if I shouldn't do this kind of PR, or should do it differently. |
Beta Was this translation helpful? Give feedback.
-
Bug description
When I submit my email in the password reset process, I get an error "Password resetter [resets] is not defined."
It seems this has come up in the past, and I tried the workarounds from those threads.
I'm on Statamic 5.7.3, Laravel 11.10.0, PHP 8.3.8, running locally under Herd.
I've moved my users to the database, following the docs, and all else works well with users.
I've set up mail sending via SMTP to Mailtrap, and confirmed it works by sending a test email from the cp/utilities/email.
I'm simply using the example code from the documentation on Tags to place the two password reset forms on pages.
The User:Forgot_Password_Form page submits.
Then instead of loading my defined page which the User:Reset_Password_Form tag is on, it goes to /!/auth/password/email and shows the error.
I discussed this issue in Discord in a thread with Erin: https://discord.com/channels/489818810157891584/1252643229715796079
How to reproduce
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Beta Was this translation helpful? Give feedback.
All reactions