Uploading through an incognito or private window in your browser prevent the pop-up.
Corrupted cache data can sometimes trigger unnecessary login prompts. Try clearing your browser cache and cookies for the specific SharePoint site.
While a PowerShell script to automatically sign in isn't recommended due to security concerns, a script to close the pop-up might be a possibility.