How can I set a custom URI for the confirmation link of account email update from a front-end form? I have a front-end form to update user's email address, like this example:

&lt;form method="post" accept-charset="UTF-8" enctype="multipart/form-data"&gt;
    {{ csrfInput() }}
    &lt;input type="hidden" name="action" value="users/save-user"&gt;
    &lt;input type="hidden" name="userId" value="{{ currentUser.id }}"&gt;

    &lt;label for="newEmail"&gt;New email address&lt;/label&gt;
    &lt;input type="email" name="email" value="" id="newEmail"&gt;

    &lt;label for="password"&gt;Password&lt;/label&gt;
    &lt;input type="password" name="password"&gt;

    &lt;input type="submit"&gt;
&lt;/form&gt;


Once the form is submitted, Craft send a system message to the user email address, with a confirmation link. Once this link is clicked, the user is redirected to the root URL of the front-end website.

I changed the activateAccountSuccessPath, but whereas it works during account activation, it doesn't works during account email update.

Example:

'activateAccountSuccessPath' =&gt; array(
    'en' =&gt; 'my-account',
    'fr' =&gt; 'mon-compte'
)


Or:

'activateAccountSuccessPath' =&gt; 'my-account'


I also tried to enable / disable the autoLoginAfterAccountActivation setting, but the redirection is still not working. Even is user is already logged in, or if he is logged out.

I also checked the Craft logs, but I there's no error, no missing template, etc. ... nothing.

How can I set a custom URI on this link?
I can't think of a clean way to do this because of this function

public function actionVerifyEmail(): Response
{
    // ..
    // snip 
    // ..
    if (Craft::$app-&gt;getUsers()-&gt;verifyEmailForUser($userToProcess)) {
        // ..
        // snip
        // ..
        // Redirect to the site/CP root
        $url = UrlHelper::url('');  // &lt;---- this is where we are
        return $this-&gt;redirect($url);  // ALWAYS redirect to root page
    }

    return $this-&gt;renderTemplate('_special/emailtaken', [
        'email' =&gt; $userToProcess-&gt;unverifiedEmail
    ]);
}


A clean way to achieve this is: 


Handle it entirely on your own -> custom controller + custom service, send the mail manually
Create a custom route to you'll only take care about activating them and overwrite the actionVerifyEmail - unfortunately you can't replace the controller via Dependency Injection
Create a feature request and hope Pixel and Tonic will be kind enough to create a config variable / event to overwrite this value