Improved auth URL handling