-
Notifications
You must be signed in to change notification settings - Fork 641
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
Redirecting after email verification #1998
Comments
This is what the activateAccountSuccessPath config setting is for. |
@brandonkelly, sorry to re-open the discussion, but still today ( |
@romainpoirier Good point! So currently
Verifying a new email address for an already-active account isn’t quite the same thing as verifying an email for a previously-inactive account, and I imagine some people will want that to redirect to a different page than the one that newly-activated users are sent to, so I think it warrants a new config setting. |
A new |
@brandonkelly, sorry to re-open the discussion, but after defined
Is it normal? If not, how to prevent this? In my case, a lot of users are registrating and keep their confirmation email in their email box as a reference for later. The confirmation link in this email is a starting point for a lot of them. |
@romainpoirier I took a close look at how email verification requests are handled today and determined there were a couple bugs with the current behavior. The user is supposed to be redirected based on your invalidUserTokenPath config setting, however that wasn’t happening if it was set to an empty string (as it is by default), which is supposed to represent the homepage. We just released 3.3.3 which fixes that, so now |
@brandonkelly is there any way of generating the |
It’s static, but you could potentially set it to the URL of a template that redirects them again based on the user account, via the |
Description
As a developer, I would like to be able to control where the page navigates to after a user verify's their email address.
Optionally wanted: Event to override from a plugin that would allow me to set the redirect.
Steps to reproduce
Code POI
UserController -> actionVerifyEmail
Only Redirects if the request accepts JSON
Content Types of the request when activation link is clicked.
Therefore the following is never called, resulting in null returning from the method.
return $this->_redirectUserAfterAccountActivation($user);
Solutions
I'm not 100% what the proper fix is for this issue. There is not a situation where you can set the content type for "application/json" in which it expects.
I have replaced the return of UserController -> actionVerifyEmail to the following
return $this->redirectToPostedUrl();
And I am overriding the 'redirect' in body params in the EVENT_AFTER_ACTIVATE_USER event from my plugin.
However, there is probably a more elegant solution.
Additional info
The text was updated successfully, but these errors were encountered: