0

I'm trying to create a forgot-password form on my site where Zoo Visitor is used to manage members, however, when adding the standard form code from the examples provided I cannot access the form url, I'm getting a 302 redirect back to my login page (I've no redirects set in my htaccess)

linking to {site_url}members/forgot-password

members/forgot-password template code:

{exp:zoo_visitor:forgot_password error_handling="inline" reset_url="/members/reset_password" parse="inward"}
    {if password_sent}
        <h3>
            A password reset mail has been sent to the provided email.
        </h3>
    {if:else}
        <fieldset>
            <p>
                <label for="email" class="form-label">
                    Your email:
                </label>
                <input type="text" name="email" id="email" class="form-text" value="" />
            </p>
            {error:email}
        </fieldset>
        <p>
            <input type="submit" value="Retrieve password" class="button" />
        </p>
    {/if}
{/exp:zoo_visitor:forgot_password}

1 Answer 1

0

I just took a peak at one of my production sites, and I have a password reset like that, but the reset_url parameter points to a different page... the actual password reset request (where an email gets sent) and the page it links to (the page where they can actually reset their password) need to be different pages (probably not need to, be easier to manage that way).

Here is an example:

Password reset request page /account/password

{exp:zoo_visitor:forgot_password error_handling="inline" reset_url="account/reset_password" parse="inward" class="forms"}
    {if password_sent}
        A password reset email has been sent to the provided email.
    {if:else}
        Password Reset
        <br>
        Enter your Email address to receive an email with instructions on how to reset your password.
        <label>
            <input type="text" name="email" id="email" placeholder="Email" maxlength="64" >
        </label>
        <label class="error">
            {error:email}
        </label>
        <label>
            <input type="submit" value="Get Password Reset Email" class="btn width-100" />
        </label>
        Please make sure to check your "Spam" folder if you don't receive the password reset email.
    {/if}
{/exp:zoo_visitor:forgot_password}

Password reset page /account/reset_password

{exp:zoo_visitor:reset_password error_handling="inline" class="forms"}
    {if password_reset}
        Your password has been reset. You can now login with your new password.
        <a href="{site_url}/login">
            Login
        </a>
    {if:else}
        Password reset
        <label>
            <input type="password" name="password" placeholder="New Password" id="new_password" class="width-100" required/>
        </label>
        <label>
            <input type="password" name="password_confirm" placeholder="New Password Again" id="new_password_confirm" class="width-100" required/>
        </label>
        <label class="error">
            {error:password}
        </label>
        <label>
            <input type="submit" value="Reset your password" class="btn width-100" />
        </label>
    {/if}
{/exp:zoo_visitor:reset_password}

Also, I'm not sure about your setup, but is your native EE member url set to /members? That could be messing with Zoo Visitor. I don't remember enough about the plugin to say for sure.

3
  • Thanks @jrothafer. I'm using pretty much identical code to yourself, I also have the same reset password form. I've tried changing the template group to account also but to no avail. Emails are not being sent out at all. Sep 18, 2015 at 10:15
  • ??? Your question says nothing about emails, just the strange redirect. Had something changed?
    – jrothafer
    Sep 18, 2015 at 12:55
  • I forgot to mention this in the original post, email notifications also arent being sent out, the forgot password template is never reached due to the redirect Sep 18, 2015 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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