Fix buildAuthUrl