Vercel integration login popup giving 401 error

3 replies
Last updated: Aug 10, 2023
Hi everyone đź‘‹ I'm trying to set up the Vercel integration, but the login popup is giving a 401 and not allowing me to login to Sanity. I've tried multiple browsers, deleted cookies and refreshed, tried being logged in and not logged in to Sanity separately and still hitting the same issue. Sorry if I'm missing something simple here or if it's a problem on Vercel's side.
AI Update

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/cookies and temporarily allow cookies for [*.]sanity.io and [*.]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:

  1. Go to your Sanity project dashboard
  2. Get your project ID and dataset name
  3. Create an API token if needed (Settings → API → Add API token)
  4. In your Vercel project settings, add environment variables:
    • SANITY_PROJECT_ID
    • SANITY_DATASET
    • SANITY_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 thread
3 replies
Excited to try out the platform. I don’t really care about having to fill in a list of vars manually, so if there’s somewhere I can be pointed to where i can find all the vars I need to make the deployment work, that’s fine.
I'm having the same issue... it's so annoying. I have done it a couple days ago without any problem but suddenly it's broken. And not having a way to do it manually is a problem too.
Our team has rolled out a fix for this so it should be resolved now. Thank you for your patience.

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.

Was this answer helpful?