postCpLoginRedirect wrong redirect when used with autoLoginAfterAccountActivation See below updates and accepted answer for a full solution


I finally discovered postCpLoginRedirect which solves my needs, even though I only need users to access their profile (which includes lots of custom fields, hopefully we'll have a few more permissions options in future for the cp).

Anyway, the issue I'm having is I want to redirect to a front-end dashboard which is at {{siteUrl}}counsellors/dashboard. This page has a {% requireLogin %} tag which redirects to the cpTrigger. And, as cp is enabled for default user groups, I understand activateAccountSuccessPath, postLoginRedirect are defunct settings.


When logging in from the Craft cpTrigger the relative link string /counsellors/dashboard works fine.
But when used in combination with the autoLoginAfterAccountActivation it directs to the wrong path (relative to the admin trigger login/counsellors/dashboard)


Ideally I'd like to keep it separate as eventually the CP will be swapped out for a front-end solution, so any clues as to why this is happening? Or what combination of settings are required to fix it?

settings:

'cpTrigger' =&gt; 'login',
'postCpLoginRedirect' =&gt; '/counsellors/dashboard',
'activateAccountSuccessPath' =&gt; '/counsellors/dashboard',
'autoLoginAfterAccountActivation' =&gt; true,
'loginPath' =&gt; 'login' # Redirect to cp trigger
// 'postLoginRedirect' =&gt; 'counsellors/dashboard',




Updates 28/01/2016:

If you're giving users access to Control Panel activateAccountSuccessPath won't work, regardless of the path — a plugin is required to make this happen.

So it seems for now at least, everything has to be built front-end as @RitterKnight suggests


A big caveat is, no matter what, if a new registered user has access to the CP, activateAccountSuccessPath is ignored. You'll need a plugin to have newly activated accounts forwarded to your success page.
Another nice addition is to use the brilliant Control Panel Nav plugin (which really I think should be built into Craft)


If you're having users login directly from CP login, you can couple this with postCpLoginRedirect if you want to hide the dashboard from users.



So to recap, full settings are now:


Front end registration, front-end success page, front-end login form, front-end dashboard;
A plugin to enforce activateAccountSuccessPath settings
Control Panel Nav plugin with a link to the custom dashboard;
The following config settings:



'loginPath' =&gt; 'counsellors/login',
'activateAccountSuccessPath' =&gt; 'counsellors/success',
// 'autoLoginAfterAccountActivation' =&gt; true, # Doesn't work
// 'postCpLoginRedirect' =&gt; 'myaccount#profile', # Optional
'postLoginRedirect' =&gt; 'counsellors/dashboard',
Ideally I'd like to keep it separate as eventually the CP will be swapped out for a front-end solution, so any clues as to why this is happening? 


I think you're close.  Just so we're on the same plane, you're using the CP for users to edit their profiles but everything else is on the front end? Do you have a front end login form already setup? If not, get one setup at counsellors/login. 

Don't set your cpTrigger and loginPath to the same values if you intend to keep the front and back end logins separate to begin with. That's issue number 1.

On the front end, you probably want to set loginPath to something like counsellors/login and you'll want to obviously uncomment your postLoginRedirect to counsellors/dashboard so after they login, they'll get shuttled off to that page.

Set  activateAccountSuccessPath to something like something like members/activation-success and then in that template,  you can do whatever you want there, either link back to the CP with a hyperlink so users can "finish" their profiles or use Craft's {% redirect %} code to send them to the CP.