2

Anybody got any suggestions on debugging autoLoginAfterAccountActivation and activateAccountSuccessPath not working?

These are set in general.php of my config but when a user activates their account (sets their password) they are redirected to the homepage and not logged in. The user is showing as active in the control panel.

Hayelp!

Hayelp! http://www.cartoonscrapbook.com/01pics-L/penelope-pitstop_L20.jpg

2 Answers 2

3

(Not necessarily a great answer to your question, but it's in the same wheelhouse and might be handy if you're working in this area)!

I remember having issues with this myself (to be honest the precise details are a bit lost in time for me - but basically IIRC it's by design that they're not logged in after creation, perhaps to force them to practise login/their password? I can't remember but do remember I found it odd behavour) - anyway in my case the issues arose as part of adding user registration during commerce checkout. It was discussed on Slack and the solution was that Steve Rowling made a very handy plugin to auto-login newly created users: https://github.com/steverowling/autologin

I'm using it, works a treat.

(I should also wrap up my code for registration during checkout as a plugin and release that one of these days!)

3
  • Okay, so further to this have been able to login with Steve Rowling's excellent plugin. However can't seem to specify where a user is directed to on login. For example via the postLoginRedirect or activateAccountSuccessPath config. Any suggestions appreciated! Sep 2, 2016 at 13:02
  • hmmm I think activateAccountSuccessPath should work to be honest - what does your config look like - when we have new users register, they definitely go to their dashboard, so it's working here (this is for new user registration right?) Sep 3, 2016 at 2:38
  • Hey Jeremy - the setting is 'activateAccountSuccessPath' => 'account', but (new) user registrations are still being sent to the site root. Ta Sep 5, 2016 at 8:20
2

Add 'autoLoginAfterAccountActivation' => true to config/general.php

Link: https://craftcms.com/docs/3.x/config/config-settings.html#autologinafteraccountactivation

Your Answer

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

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