Update generate authorize url function