Redirect to the previous page after login.