<p>Picking this up with another project, it looks like the problem was me not specifying a template path as the 'setPasswordPath' config setting. Instead, I was passing a route. I was doing this because I wanted to use the same password template to handle everything to do with passwords. This isn't possible, by the looks of it, because the controller is looking for the existence of a file (as opposed to a template being returned from a route or URI).</p>

<p>As soon as I changed it to a strict template path everything worked fine, and the following line in UsersController.php no longer returns false:</p>

<pre><code>if (craft()-&gt;templates-&gt;doesTemplateExist($templatePath))
</code></pre>

<p>So this is solved.</p>

CC BY-SA 3.0
2018-02-01T23:42:58.253Z
Follow-up from 11 months later... impressive!
Brad Bell
CC BY-SA 4.0
2019-04-17T10:41:37.017Z
But I don't want the end user being sent a URL in an email that *contains a path to a file*. That's... silly? Plus, I put these files that *should not be directly accessible* inside a `_hidden` folder specifically to stop direct access. You get to URLs through routes, damn it.
Matt Wilcox
CC BY-SA 4.0
2019-10-25T11:30:41.863Z
Thanks so much. I've been struggling with the same thing.
outline4
CC BY-SA 4.0
2019-10-25T11:31:26.270Z
I'm all with @MattWilcox it should be possible to add a route.
outline4
CC BY-SA 3.0
2018-02-01T15:25:50.903Z
2018-02-01T15:25:50.903Z
Clive Portman
<p>In case someone is still having issues. <code>setPasswordPath</code> is actually expecting a template path and not a route.</p>

<p><code>'setPasswordPath' =&gt; 'myauth/set-password'</code></p>

<p>I have a file that lives in here:</p>

<p><code>MyCraftProjectFolder &gt; templates &gt; myauth &gt; set-password.twig</code></p>

<p>Some may get confused because of the name "Path" at the end of <code>setPasswordPath</code> as many other config names include the word Paths and is expecting a route path. In this case setPasswordPath is expecting a template path.</p>

CC BY-SA 4.0
2019-11-28T00:26:48.303Z
2019-11-28T00:26:48.303Z
Jessica Talzor
<p>Any idea why the following would be ignored following a frontend new password form? The user group does not have access to the control panel.</p>

<pre><code>'setPasswordPath' =&gt; 'account/login/password/new',
</code></pre>

<p>The following success path on the next line works fine:</p>

<pre><code>'setPasswordSuccessPath' =&gt; 'account/login/password/done',
</code></pre>

<p>The user workflow:</p>

<ol>
<li>Start on frontend Register form with firstname, lastname, email and password.</li>
<li>Account created and user is logged-in. No email confirmation needed.</li>
<li>User logs out.</li>
<li>User completes Forgotten Password form and email is sent.</li>
<li>User clicks password link in email and sees the Craft CMS password form.</li>
</ol>

<p>I've tried this with and without the email address having a pre-existing Craft Commerce order associated with it. The result is the same.</p>

CC BY-SA 3.0
2017-03-10T18:57:50.227Z
Can you describe the front-end user workflow where it's not working and what you're seeing instead?  If this for a brand new user where there wasn't a password field on user creation?  An existing user that's just updating their password?
Brad Bell
CC BY-SA 3.0
2017-03-13T09:34:18.577Z
Hi Brad. I've updated the question to include the user workflow.
Clive Portman
CC BY-SA 3.0
2017-03-13T22:55:27.330Z
You're positive the user you're testing with doesn't have CP access and that a template exists at `account/login/password/new`? The logic Craft uses there is pretty straight-forward: https://github.com/pixelandtonic/Craft-Release/blob/master/app/controllers/UsersController.php#L1639
Brad Bell
CC BY-SA 3.0
2017-06-21T18:16:52.420Z
I have the exact same issue... The link in the email is set to https://mysite.com/actions/users/setpassword?code=x&id=y. instead of the https://mysite.com/passwordPath?code=x&id=y. And even if you copy the query part to the template you've specified in setPasswordPath, it does not display that template, but only the internal template. is this a bug or don't I understand the setting?
outline4
CC BY-SA 3.0
2017-06-21T18:18:52.760Z
and to worsen things: the user is not automatically logged in after setting the new password... it redirects fine to setPasswordSuccessPath but the user is not logged in. that is in Craft CMS 2.6.2982.
outline4
CC BY-SA 3.0
2017-06-21T18:22:18.983Z
Users don't have access to CP and the forget password form is set on the frontend.
outline4
CC BY-SA 3.0
2018-02-01T14:57:31.023Z
I'm encountering this again. We just lived with it in the end. Anyone?
Clive Portman
<config><login><password>
setPasswordPath being ignored
# setPasswordPath being ignored

(Asked by: username_0 on 2017-03-10)

Any idea why the following would be ignored following a frontend new password form? The user group does not have access to the control panel.
'setPasswordPath' => 'account/login/password/new',

The following success path on the next line works fine:
'setPasswordSuccessPath' => 'account/login/password/done',

The user workflow:

Start on frontend Register form with firstname, lastname, email and password.
Account created and user is logged-in. No email confirmation needed.
User logs out.
User completes Forgotten Password form and email is sent.
User clicks password link in email and sees the Craft CMS password form.

I've tried this with and without the email address having a pre-existing Craft Commerce order associated with it. The result is the same.

**Tags:** config, login, password
> **Comments:**
> **username_1**: Can you describe the front-end user workflow where it's not working and what you're seeing instead?  If this for a brand new user where there wasn't a password field on user creation?  An existing user that's just updating their password?  
> **username_0**: Hi Brad. I've updated the question to include the user workflow.  
> **username_1**: You're positive the user you're testing with doesn't have CP access and that a template exists at `account/login/password/new`? The logic Craft uses there is pretty straight-forward: https://github.com/pixelandtonic/Craft-Release/blob/master/app/controllers/UsersController.php#L1639  
> **username_2**: I have the exact same issue... The link in the email is set to https://mysite.com/actions/users/setpassword?code=x&id=y. instead of the https://mysite.com/passwordPath?code=x&id=y. And even if you copy the query part to the template you've specified in setPasswordPath, it does not display that template, but only the internal template. is this a bug or don't I understand the setting?  
> **username_2**: and to worsen things: the user is not automatically logged in after setting the new password... it redirects fine to setPasswordSuccessPath but the user is not logged in. that is in Craft CMS 2.6.2982.  
> **username_2**: Users don't have access to CP and the forget password form is set on the frontend.  
> **username_0**: I'm encountering this again. We just lived with it in the end. Anyone?  

---

## 2 answers

### Answer by username_0 on 2018-02-01. Score: 3 | Accepted answer

Picking this up with another project, it looks like the problem was me not specifying a template path as the 'setPasswordPath' config setting. Instead, I was passing a route. I was doing this because I wanted to use the same password template to handle everything to do with passwords. This isn't possible, by the looks of it, because the controller is looking for the existence of a file (as opposed to a template being returned from a route or URI).
As soon as I changed it to a strict template path everything worked fine, and the following line in UsersController.php no longer returns false:
if (craft()->templates->doesTemplateExist($templatePath))

So this is solved.

> **Comments:**
> **username_1**: Follow-up from 11 months later... impressive!  
> **username_3**: But I don't want the end user being sent a URL in an email that *contains a path to a file*. That's... silly? Plus, I put these files that *should not be directly accessible* inside a `_hidden` folder specifically to stop direct access. You get to URLs through routes, damn it.  
> **username_2**: Thanks so much. I've been struggling with the same thing.  
> **username_2**: I'm all with @MattWilcox it should be possible to add a route.  

---

### Answer by username_4 on 2019-11-28. Score: 1

In case someone is still having issues. `setPasswordPath` is actually expecting a template path and not a route.

`'setPasswordPath' => 'myauth/set-password'`

I have a file that lives in here:

`MyCraftProjectFolder > templates > myauth > set-password.twig`

Some may get confused because of the name "Path" at the end of `setPasswordPath` as many other config names include the word Paths and is expecting a route path. In this case setPasswordPath is expecting a template path.


---

