Redirect to the previous page after Successful login/registration

Hi bricks team,

Generally, after successful login/registration, the user is redirected to the page they were on before registration.

Especially on a ecommerce website, this will be very useful.