Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoLoginAfterAccountActivation and activateAccountSuccessPath are not working anymore #5980

Closed
romainpoirier opened this issue Apr 28, 2020 · 7 comments

Comments

@romainpoirier
Copy link

romainpoirier commented Apr 28, 2020

Description

The autoLoginAfterAccountActivation is not working anymore. After the activation link is clicked, the account is activated but the user is still not logged in. Checking the web.log file reveals no evidence of error.

Furthermore, I don't know if this is a related issue (let me know if not, and I'll open another ticket), but the activateAccountSuccessPath also doesn't work.

I was used to use redirect to the My Account section after login, like this:

'activateAccountSuccessPath' => function() {
    return Entry::find()->section('myAccount')->one()->uri ?? null;
},

If the use is not logged in, this page show a log in form. But from now, it redirects to the siteUrl instead. Whereas the ->uri is correct, I also tried using the ->url, but got the same redirect to the siteUrl instead.

Note that I'm not using the verifyEmailPath config as activateAccountSuccessPath is set to true (that was working fine without on a previous project).

Steps to reproduce

  1. Set autoLoginAfterAccountActivation to true in config/general.php
  2. Register a user from a front-end form (users/save-user)
  3. Click the activation link in the confirmation email
  4. Check if user is logged in

Additional info

  • Craft version: Craft Pro 3.4.17.1
  • PHP version: 7.1.30
  • Database driver & version: MySQL 5.7.26
  • Plugins & versions: Agent 1.1.6, Control Panel Body Classes 2.2.0, Control Panel CSS 2.2.1, Control Panel JS 2.2.1, CP Field Inspect 1.1.3, Dashboard Begone 1.0.1, Dumper 2.0.0, Embedded Assets 2.2.1.1, Expanded Singles 1.1.2, Imager v2.4.0, Mandrill 1.3.1, Minify 1.2.10, Neo 2.7.9, Redactor 2.6.1, Retcon 2.1.0, Style Inliner 2.0.1, Typogrify 1.1.18, Wishlist 1.2.6, XML Sitemap 1.2.0, Zendesk 1.0.6
@romainpoirier romainpoirier changed the title autoLoginAfterAccountActivation is not working anymore autoLoginAfterAccountActivation and activateAccountSuccessPath are not working anymore Apr 28, 2020
@brandonkelly
Copy link
Member

The user will be logged in or not depending on the value of the autoLoginAfterAccountActivation config setting. Is that enabled?

@romainpoirier
Copy link
Author

Yes of course (step 1. of Steps to reproduce). I also double-checked my config/general.php file.

@brandonkelly
Copy link
Member

Please send your composer.json and composer.lock files, plus a database backup, into support@craftcms.com, and we can look into this from there.

@romainpoirier
Copy link
Author

Done ✔ Thank you!

@brandonkelly
Copy link
Member

Thanks! Just got this fixed for the next release.

To get the fix early, change your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop#943c838b0c866df8d0e033aa68526c477709ac5e as 3.4.17.1",
  "...": "..."
}

Then run composer update.

@brandonkelly
Copy link
Member

Craft 3.4.18 is out now with this fix.

@romainpoirier
Copy link
Author

Thank you Brandon! I will check it out a.s.a.p.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants