Redirect in 'user.changePassword:after' hook

Hi all

I have the following hook in my config file

...
'user.changePassword:after' => function ($newUser, $oldUser) {
    go('/');
},
...

The redirect fails with the message " The JSON response of the API could not be parsed:"
The error output shows the page I am redirecting to.

Is it not possible to have redirects in :after hooks?

Thanks for clarifying!
Memi

Exactly, you cannot return anything or redirect from a hook.

Thanks!
And I just saw the big blue infobox telling me that this is not possible… I completely missed that since it was below the list of hooks and I never went there.
Might moving it above the list be an option?

Thanks again!