Vercel integration login popup giving 401 error
I understand how frustrating this is! A 401 error during the Vercel integration login popup definitely sounds like an authentication issue. Since you've already tried the obvious troubleshooting steps (multiple browsers, clearing cookies, different login states), let me suggest some additional things to check.
Most Likely Causes
1. Third-Party Cookie Blocking
Modern browsers have increasingly strict privacy settings that can interfere with OAuth authentication popups. When the Vercel integration tries to authenticate with Sanity through a popup, it needs to set cookies across domains. If your browser blocks these, you'll get authentication failures.
Try these browser-specific fixes:
- Chrome: Go to
chrome://settings/cookiesand temporarily allow cookies for[*.]sanity.ioand[*.]vercel.com - Safari: Settings → Privacy → temporarily disable "Prevent cross-site tracking"
- Firefox:
about:preferences#privacy→ set Enhanced Tracking Protection to "Standard" - Brave: Shields settings → allow cookies for Sanity and Vercel domains
2. Browser Extensions
Ad blockers, privacy extensions (uBlock Origin, Privacy Badger, Ghostery), or security tools can block authentication popups. Try temporarily disabling these extensions.
3. Popup Blockers
Check your browser's address bar for a blocked popup notification. Ensure popups are allowed for both Vercel and Sanity domains.
4. Network or Firewall Restrictions
If you're on a corporate network or VPN, there might be network-level restrictions blocking the OAuth flow. Try from a different network if possible.
Alternative: Manual Configuration
If the popup authentication continues to fail, you can manually set up your Vercel project with Sanity environment variables:
- Go to your Sanity project dashboard
- Get your project ID and dataset name
- Create an API token if needed (Settings → API → Add API token)
- In your Vercel project settings, add environment variables:
SANITY_PROJECT_IDSANITY_DATASETSANITY_API_TOKEN(for authenticated requests)
This bypasses the integration popup entirely while giving you the same functionality.
Check Platform Status
While less likely, there could be a temporary issue on either platform. Check status.sanity.io and Vercel's status page to rule out ongoing incidents.
Get More Help
If none of these work:
- Contact Sanity support through the help chat in your Sanity dashboard
- Join the Sanity community on Discord for real-time troubleshooting help
- Check if there are any console errors in your browser's developer tools that might give more specific clues
Start with the third-party cookie settings first, as that's a common culprit for cross-domain authentication issues. Good luck getting it sorted!
Show original thread3 replies
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.