It looks like the new setPasswordUrl is not working correctly. It doesn't output anything.
Looking through the code I wondered if this was a bug as comparing the lines to the loginUrl and logoutUrl it looks slightly different:
Current Code (lines 1284-1288)
'isInstalled' => $isInstalled,
'loginUrl' => UrlHelper::siteUrl($generalConfig->getLoginPath()),
'logoutUrl' => UrlHelper::siteUrl($generalConfig->getLogoutPath()),
'setPasswordUrl' => $setPasswordRequestPath !== null ? UrlHelper::siteUrl($setPasswordRequestPath) : null,
'now' => new DateTime(null, new \DateTimeZone(Craft::$app->getTimeZone()))
Is it missing the $generalConfig-> part?
Should it be:
'isInstalled' => $isInstalled,
'loginUrl' => UrlHelper::siteUrl($generalConfig->getLoginPath()),
'logoutUrl' => UrlHelper::siteUrl($generalConfig->getLogoutPath()),
'setPasswordUrl' => $setPasswordRequestPath !== null ? UrlHelper::siteUrl($generalConfig->$setPasswordRequestPath) : null,
'now' => new DateTime(null, new \DateTimeZone(Craft::$app->getTimeZone()))
@terryupton That variable is set further up in the code you referenced.
Can you clarify which Craft version you鈥檙e using and exactly what steps you took (config + template)?
I just tried this with Craft 3.5.16, adding the following to config/general.php...
'setPasswordRequestPath' => '/foo/bar/pass',
...putting {{ setPasswordUrl }} into a .twig template, and having https://test.site/foo/bar/pass rendered in the browser.
If I remove the setPasswordRequestPath line from config/general.php, nothing is rendered in the browser which is the expected behavior.
@terryupton Make sure you are settting setPasswordRequestPath (URI to the _forgot password page_) and not setPasswordPath (URI to the reset form itself - docs)
Good spot @olivierbon - this was the exact problem.
I have now updated and can confirm all working as expected.
Thanks @mattstein and @olivierbon 馃憤馃徎
Most helpful comment
Good spot @olivierbon - this was the exact problem.
I have now updated and can confirm all working as expected.
Thanks @mattstein and @olivierbon 馃憤馃徎