One Vercel Setting Skipped a Deploy, Then Broke Sign-In

On November 2, a merge into main passed CI, but its Vercel deployment was canceled after three seconds. Removing the build-skip command got the next deployment built. That deployment then failed on the authentication routes.
Both failures depended on the same project setting: whether Vercel exposed its system environment variables. The repository's checks covered neither that setting nor the deployed sign-in flow.
Why the production build skipped itself
The project, my-app-center, had this Ignored Build Step command in its Vercel settings:
if [ "$VERCEL_ENV" == "production" ]; then exit 1; else exit 0; fi
The exit codes are easy to misread. For an Ignored Build Step, Vercel treats 1 as permission to continue the build and 0 as an instruction to cancel it. The command allows production builds only when VERCEL_ENV actually contains production. An empty value takes the else branch and cancels the build.
The incident record shows a successful build at 22:22 UTC on November 1 and a skipped build at 22:37 UTC. A later settings inspection found system environment variable exposure disabled (autoExposeSystemEnvs in the project API). That explains the empty variable, but the build timestamps alone do not establish exactly when the setting changed or who changed it.
The deployment record and build log showed the cancellation. CI had passed because its checks did not inspect the Vercel project settings or verify that this commit reached production.
Why the next deployment failed on authentication
Clearing the command (commandForIgnoringBuildStep in the project API) allowed a redeploy to build. The incident record then reports failures across /api/auth/*:
UntrustedHost: Host must be trusted
In the version used by this project, @auth/core 0.41.3, an explicit trustHost configuration takes precedence. Otherwise, Auth.js derives the setting from AUTH_URL, AUTH_TRUST_HOST, VERCEL, CF_PAGES, or a non-production NODE_ENV.
This production deployment had relied on VERCEL. Vercel documents that variable as an indicator that system environment variables are exposed. With exposure disabled and no other applicable trust signal, Auth.js rejected the requests. The older deployments continued working; rebuilding without those variables exposed the dependency.
The redeploy had cleared the first obstacle without fixing the shared configuration problem.
Restore service, then remove the implicit dependency
The incident record describes two changes. Re-enabling system environment variables restored sign-in. Adding an explicit production URL then removed this project's reliance on VERCEL for host-trust inference:
AUTH_URL=https://app-center.vercel.app
For next-auth 5.0.0-beta.32, an origin-only URL keeps the default /api/auth base path. Auth.js can normally infer the host on supported platforms; the explicit URL gave this deployment a stable production origin and a trust signal independent of VERCEL.
The build-skip command stayed empty. The repository already used vercel.json to enable Git deployments for main and disable them for other branches, so there was no need for a second branch filter that depended on VERCEL_ENV.
Check the deployment and the user flow separately
These were the project's checks while it ran. The app-center Vercel project was deleted on November 16, so substitute your own project name, scope and domain.
Before another redeploy, inspect the two settings that mattered here:
vercel api /v9/projects/app-center
Read commandForIgnoringBuildStep and autoExposeSystemEnvs; do not assume they match the last successful deployment.
After a merge or configuration change, check that the deployment list shows a Ready production deployment for the merge commit:
vercel ls app-center --scope donminzzi-projects
Then probe the production session endpoint:
curl -s -o /dev/null -w '%{http_code}' https://app-center.vercel.app/api/auth/session
For this app, the expected status was 200. An unauthenticated session request can return 200, so this is a route-health check, not proof that a user can complete sign-in. Follow it with the actual login and callback flow.
Those production checks were outside the CI path that passed during the incident. Adding them would test something the existing green build never established: that the intended commit was deployed and authentication still worked.
Get the next post.
Follow new posts in your RSS reader.