Handle redirect to next url on login