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 triggerlogin/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' => 'login',
'postCpLoginRedirect' => '/counsellors/dashboard',
'activateAccountSuccessPath' => '/counsellors/dashboard',
'autoLoginAfterAccountActivation' => true,
'loginPath' => 'login' # Redirect to cp trigger
// 'postLoginRedirect' => '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.
- If you're having users login directly from CP login, you can couple this with
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
settingsControl Panel Nav plugin with a link to the custom dashboard;
The following config settings:
'loginPath' => 'counsellors/login',
'activateAccountSuccessPath' => 'counsellors/success',
// 'autoLoginAfterAccountActivation' => true, # Doesn't work
// 'postCpLoginRedirect' => 'myaccount#profile', # Optional
'postLoginRedirect' => 'counsellors/dashboard',
cpTrigger
for all logins, but redirect them to the dashboard as a starting point — which seems like it should be possible, but perhaps not! SologinPath
is intentionally redirecting{% requireLogin %} to standard login, works as expected.
autoLoginAfterAccountActivation` doesn't seem to play nice withpostCpLoginRedirect
:(