5

At the moment when a user clicks on the forgot password link in an email the following happens:

  1. User is redirected to the forgot password page.
  2. User enters their new password.
  3. User is redirected to the Craft admin login page.

Is there a way to set where they are sent to? For example, if they do not have admin access I don't want to be showing them the admin login page.

Thanks,

Gareth

5

You can. You have to build some front end forms:

  1. Forgot Password Form (http://buildwithcraft.com/docs/templating/forgot-password-form)
  2. Set Password Form (http://buildwithcraft.com/docs/templating/set-password-form)

Be aware of the config setting, setPasswordPath.

It's also worth noting that a user account with control panel privileges will be redirected to the control panel set password and login no matter what.

Edit: Also, check out setPasswordSuccessPath for redirecting the user after they've successfully set their new password. Again, this only applies to non admin users that have completed this process using the front end forms you have setup.

  • Perfect, I had missed that, thank you Peter. – Gareth Sep 3 '14 at 14:14
  • Shouldn't this work when filling in the hidden input value? <input type="hidden" name="redirect" value="{{ siteUrl }}/service"> For me it doesn't, but it seems it should, without the need to fill in those variables in the config. – Tom De Smet Nov 16 '14 at 19:39
  • I've created a new password set form in my templates folder and updated the setPasswordPath using the following in config/general.php but it's still pointing to the standard page. Any ideas? return array( 'setPasswordPath' => 'user/set-password' ); – richardpixel Jan 13 '16 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.