Skip to content
New issue

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

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

Already on GitHub? # to your account

User logged out when trying to verify a changed email address #1421

Closed
angrybrad opened this issue Feb 24, 2017 · 0 comments
Closed

User logged out when trying to verify a changed email address #1421

angrybrad opened this issue Feb 24, 2017 · 0 comments
Assignees
Labels
bug severity:minor Cosmetic issues or bugs with simple workarounds

Comments

@angrybrad
Copy link
Member

angrybrad commented Feb 24, 2017

Description

When trying to verify a new email address of an existing user by clicking the link in the email, after changing it in a front-end "edit account" form, logged-in users get logged out by UsersController::_processTokenRequest().

They then have to log back in continue editing their profile. This feels like bad UX workflow for existing accounts.

Related issue: #1422

One workaround in Craft 2 is to write a plugin that does something like:

craft()->on('userSession.beforeLogout', function(Event $event) 
{ 
    $user = $event->params['user'];

    if ($user->unverifiedEmail) 
    { 
        craft()->userSession->setNotice(Craft::t('Your email address has been updated.'));

        $event->performAction = false; 
    } 
});

Steps to reproduce

  1. Create a front-end login, register and edit profile form.
  2. Register a new user.
  3. Change that users email address.
  4. Click on link in email. Email is verified, but you get logged out.

Additional info

  • Craft version: 2.x and 3.x
  • PHP version: n/a
  • Database driver & version: n/a
  • Plugins & versions: n/a
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug severity:minor Cosmetic issues or bugs with simple workarounds
Projects
None yet
Development

No branches or pull requests

2 participants