<p>For Craft 2.6, if a hidden <code>redirect</code> input is set, Craft will now follow it first and fallback to the <a href="https://craftcms.com/docs/config-settings#activateAccountSuccessPath" rel="nofollow">activateAccountSuccessPath</a> if it's not available.</p>

CC BY-SA 3.0
2016-01-12T00:10:39.327Z
Thanks Brad! When is 2.6 coming out? soonish? Looks like Craft is only at 2.5.2757. Is there something I can do to patch it at the moment?
Cavell Blood
CC BY-SA 3.0
2016-01-12T00:24:36.940Z
No ETA on 2.6, but hit up support@craftcms.com for the patched file if you want it. Just keep in mind that an auto-update could overwrite it at anytime, though.
Brad Bell
CC BY-SA 3.0
2016-01-12T00:26:48.013Z
That's true. Ok, I'll send for a patched file. Thanks.
Cavell Blood
CC BY-SA 3.0
2016-01-12T23:36:00.537Z
The patched file fixed this problem.
Cavell Blood
CC BY-SA 3.0
2016-01-11T23:57:23.377Z
2016-01-11T23:57:23.377Z
Brad Bell
<p>This probably isn't the answer you're looking for (it should be honoring your redirect) but if that's the only form being used for registrations, you could set <code>'activateAccountSuccessPath' =&gt; 'volunteer/identity'</code> in your config file.</p>

CC BY-SA 3.0
2015-12-16T20:36:26.383Z
Yes, that's true. It should be honoring the redirect. I can try that for now but I'd rather not hard code this. This should work for now. Thanks!
Cavell Blood
CC BY-SA 3.0
2016-01-15T09:17:24.877Z
@cavellblood Thank you for this heads-up. Very helpful. I will mail them too.
tom
CC BY-SA 3.0
2015-12-23T10:43:32.407Z
I have the same issue as OP, and since we work with e-mail address verification, this workaround isn't suitable. It should honor the right settings, indeed.
tom
CC BY-SA 3.0
2016-01-12T23:36:59.943Z
@tom: I emailed support@craftcms.com and they sent me a patched file that fixed the issue for now.
Cavell Blood
CC BY-SA 3.0
2015-12-16T20:28:37.220Z
2015-12-16T20:37:40.973Z
2015-12-16T20:37:40.973Z
Chase Giunta
<p>I'm using the following code but the redirect is not working. After the user registers it takes them back to the home page and not to <code>volunteer/identity</code>. I put a message on the homepage to display if the user is logged in and it appears that they are logged it at that point. This used to work before 2.5 on a different site that I haven't upgraded to 2.5. But now on this new install of 2.5 I can't get it to work.</p>

<p>Has anyone else experienced the same issues?</p>

<pre><code>{% extends "_layout" %}

{% block content %}

&lt;form method="post" accept-charset="UTF-8"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="action" value="users/saveUser"&gt;
    &lt;input type="hidden" name="redirect" value="volunteer/identity"&gt;

    {% macro errorList(errors) %}
        {% if errors %}
            &lt;ul class="errors"&gt;
                {% for error in errors %}
                    &lt;li&gt;{{ error }}&lt;/li&gt;
                {% endfor %}
            &lt;/ul&gt;
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    &lt;label for="firstName"&gt;First Name&lt;/label&gt;
    &lt;input id="firstName" type="text" name="firstName" {% if account is defined %} value="{{ account.firstName }}"{% endif %}&gt;

    {% if entry is defined %}
        {{ errorList(account.getErrors('firstName')) }}
    {% endif %}

    &lt;label for="lastName"&gt;Last Name&lt;/label&gt;
    &lt;input id="lastName" type="text" name="lastName" required {% if account is defined %} value="{{ account.lastName }}{% endif %}"&gt;

    {% if entry is defined %}
        {{ errorList(account.getErrors('lastName')) }}
    {% endif %}

    &lt;label for="email"&gt;Email&lt;/label&gt;
    &lt;input id="email" type="text" name="email"
        {% if account is defined %} value="{{ account.email }}"{% endif %}&gt;

    {% if account is defined %}
        {{ errorList(account.getErrors('email')) }}
    {% endif %}

    &lt;label for="password"&gt;Password&lt;/label&gt;
    &lt;input id="password" type="password" name="password"&gt;

    {% if account is defined %}
        {{ errorList(account.getErrors('password')) }}
    {% endif %}

    &lt;button type="submit" class="button"&gt;Save and continue&lt;/button&gt;

&lt;/form&gt;

{% endblock %}
</code></pre>

<p>My config file looks like this:</p>

<pre><code>return array(
    'devMode' =&gt; true,
    'useEmailAsUsername' =&gt; true,
    'autoLoginAfterAccountActivation' =&gt; true,
    'omitScriptNameInUrls' =&gt; true,
    'setPasswordPath' =&gt; array(
        'en' =&gt; 'account/setpassword'
    ),
);
</code></pre>

CC BY-SA 3.0
2015-12-16T19:50:34.423Z
So, if it's redirecting to the homepage and they are logged in, you're saying that it also skips the whole activation/email verification process altogether, correct? Anything in `craft/storage/runtime/logs` ?
Chase Giunta
CC BY-SA 3.0
2015-12-16T19:54:11.117Z
Yes, I've turned off Verify email addresses in `admin/settings/users/settings` so it doesn't verify anything. I'll check the logs now.
Cavell Blood
CC BY-SA 3.0
2015-12-16T20:00:34.317Z
@ChaseGiunta I checked the logs for `redirect` and I found this

    $_POST=array (
      'action' => 'users/saveUser'
      'redirect' => 'volunteer/identity'
      'firstName' => 'qwetr'
      'lastName' => 'erty'
      'email' => 'fdgh@me.com'
      'password' => REDACTED
    )

So it looks like it is getting the correct values.
Cavell Blood
<redirect><registration><devmode>
User Registration Form Redirect not working Craft 2.5
# User Registration Form Redirect not working Craft 2.5

(Asked by: username_0 on 2015-12-16)

I'm using the following code but the redirect is not working. After the user registers it takes them back to the home page and not to volunteer/identity. I put a message on the homepage to display if the user is logged in and it appears that they are logged it at that point. This used to work before 2.5 on a different site that I haven't upgraded to 2.5. But now on this new install of 2.5 I can't get it to work.
Has anyone else experienced the same issues?
{% extends "_layout" %}

{% block content %}


    {{ getCsrfInput() }}
    
    

    {% macro errorList(errors) %}
        {% if errors %}
            
                {% for error in errors %}
                    {{ error }}
                {% endfor %}
            
        {% endif %}
    {% endmacro %}

    {% from _self import errorList %}

    First Name
    

    {% if entry is defined %}
        {{ errorList(account.getErrors('firstName')) }}
    {% endif %}

    Last Name
    

    {% if entry is defined %}
        {{ errorList(account.getErrors('lastName')) }}
    {% endif %}

    Email
    

    {% if account is defined %}
        {{ errorList(account.getErrors('email')) }}
    {% endif %}

    Password
    

    {% if account is defined %}
        {{ errorList(account.getErrors('password')) }}
    {% endif %}

    Save and continue



{% endblock %}

My config file looks like this:
return array(
    'devMode' => true,
    'useEmailAsUsername' => true,
    'autoLoginAfterAccountActivation' => true,
    'omitScriptNameInUrls' => true,
    'setPasswordPath' => array(
        'en' => 'account/setpassword'
    ),
);

**Tags:** redirect, registration, devmode

> **Comments:**
> **username_1**: So, if it's redirecting to the homepage and they are logged in, you're saying that it also skips the whole activation/email verification process altogether, correct? Anything in `craft/storage/runtime/logs` ?  
> **username_0**: Yes, I've turned off Verify email addresses in `admin/settings/users/settings` so it doesn't verify anything. I'll check the logs now.  
> **username_0**: @ChaseGiunta I checked the logs for `redirect` and I found this      $_POST=array (       'action' => 'users/saveUser'       'redirect' => 'volunteer/identity'       'firstName' => 'qwetr'       'lastName' => 'erty'       'email' => 'fdgh@me.com'       'password' => REDACTED     )  So it looks like it is getting the correct values.  

---

## 2 answers

### Answer by username_2 on 2016-01-11. Score: 2 | Accepted answer

For Craft 2.6, if a hidden `redirect` input is set, Craft will now follow it first and fallback to the [activateAccountSuccessPath](https://craftcms.com/docs/config-settings#activateAccountSuccessPath) if it's not available.

> **Comments:**
> **username_0**: Thanks Brad! When is 2.6 coming out? soonish? Looks like Craft is only at 2.5.2757. Is there something I can do to patch it at the moment?  
> **username_2**: No ETA on 2.6, but hit up support@craftcms.com for the patched file if you want it. Just keep in mind that an auto-update could overwrite it at anytime, though.  
> **username_0**: That's true. Ok, I'll send for a patched file. Thanks.  
> **username_0**: The patched file fixed this problem.  

---

### Answer by username_1 on 2015-12-16. Score: 0

This probably isn't the answer you're looking for (it should be honoring your redirect) but if that's the only form being used for registrations, you could set `'activateAccountSuccessPath' => 'volunteer/identity'` in your config file.

> **Comments:**
> **username_0**: Yes, that's true. It should be honoring the redirect. I can try that for now but I'd rather not hard code this. This should work for now. Thanks!  
> **username_3**: I have the same issue as OP, and since we work with e-mail address verification, this workaround isn't suitable. It should honor the right settings, indeed.  
> **username_0**: @username_3: I emailed support@craftcms.com and they sent me a patched file that fixed the issue for now.  
> **username_3**: @cavellblood Thank you for this heads-up. Very helpful. I will mail them too.  

---

