Blink CLI Authentication Hangs After Browser Success
Summary
blink login and blink deploy hang indefinitely on "Waiting for authentication..." even after the browser-based auth flow completes successfully. No session/config file is created.
Environment
- Host OS: macOS (Mac Mini)
- Blink CLI: v1.1.39
- Blink Server: ghcr.io/coder/blink-server:7a1e123
- Docker: Docker Desktop for Mac
- Network: Tailscale (tailnet-only access)
Network Architecture
┌─────────────────────────────────────────────────────────────────────────────┐
│ Mac Mini (Host) │
│ │
│ ┌─────────────┐ ┌──────────────────┐ ┌─────────────────────────┐ │
│ │ Ollama │ │ Tailscale Serve │ │ Blink CLI │ │
│ │ :11434 │ │ │ │ (blink login/deploy) │ │
│ │ (localhost) │ │ HTTPS :443 ───────────▶ polls for auth callback │ │
│ └─────────────┘ │ │ │ └─────────────────────────┘ │
│ ▲ │ ▼ │ │
│ │ │ localhost:3000 │ │
│ │ └────────┬─────────┘ │
│ │ │ │
│ │ ┌───────────────┴───────────────┐ │
│ │ │ Docker Bridge │ │
│ │ │ (host.docker.internal) │ │
│ │ └───────────────┬───────────────┘ │
│ │ │ │
│ ┌──────┴─────────────────────┴─────────────────────────────────────────┐ │
│ │ Docker Containers │ │
│ │ │ │
│ │ ┌─────────────────────────┐ ┌─────────────────────────────────┐ │ │
│ │ │ blink-server:7a1e123 │ │ postgres:17-alpine │ │ │
│ │ │ (agent-blink-server-1)│ │ (agent-postgres-1) │ │ │
│ │ │ │ │ │ │ │
│ │ │ :3000 ◀── published │ │ :5432 │ │ │
│ │ │ to host :3000 │ │ │ │ │
│ │ └────────────┬────────────┘ └─────────────────────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌─────────────────────────┐ │ │
│ │ │ blink-agent:latest │ ◀── spawned by blink-server │ │
│ │ │ (deployed agent) │ │ │
│ │ │ │ │ │
│ │ │ Needs OLLAMA_BASE_URL │ │ │
│ │ │ =http://host.docker. │ │ │
│ │ │ internal:11434/v1 │ │ │
│ │ └─────────────────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
│ Tailscale (MagicDNS)
▼
https://erics-mac-mini.tail29e42.ts.net
(tailnet devices only)
Blink Server Configuration
# Environment variables (from docker exec)
BLINK_ACCESS_URL=https://erics-mac-mini.tail29e42.ts.net
BLINK_API_SERVER_LISTEN_PORT=3000
BLINK_PORT=3000
BLINK_AUTH_SECRET=<redacted>
BLINK_POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/blink
docker-compose.yaml
services:
blink-server:
image: ghcr.io/coder/blink-server:7a1e123
restart: unless-stopped
user: "0:0" # root for docker.sock access
ports:
- "3000:3000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- blink-config:/home/server/.config/blink-server/
environment:
- BLINK_POSTGRES_URL=postgresql://postgres:postgres@postgres:5432/blink
- BLINK_ACCESS_URL=https://erics-mac-mini.tail29e42.ts.net
- BLINK_API_SERVER_LISTEN_PORT=3000
- BLINK_PORT=3000
- BLINK_AUTH_SECRET=<redacted>
postgres:
image: postgres:17-alpine
# ... standard postgres config
Tailscale Serve Configuration
$ tailscale serve status
https://erics-mac-mini.tail29e42.ts.net (tailnet only)
|-- / proxy http://127.0.0.1:3000
Steps to Reproduce
-
Start the control plane:
-
Verify server is running:
curl https://erics-mac-mini.tail29e42.ts.net/
# Returns: /login (redirect)
-
Attempt to authenticate:
export BLINK_API_URL=https://erics-mac-mini.tail29e42.ts.net
blink login
-
Browser opens to auth page, complete the flow → Browser shows "Success"
-
CLI remains stuck:
Visit https://erics-mac-mini.tail29e42.ts.net/auth?id=<uuid> to authenticate with Blink.
Press [ENTER] to open the browser
│
◒ Waiting for authentication...
Observations
- Browser auth succeeds: The auth page loads, login completes, success message displays
- CLI never receives callback: Hangs indefinitely on "Waiting for authentication..."
- No config file created:
~/.config/blink/config.json does not exist after auth
- Same behavior on localhost: Using
BLINK_API_URL=http://localhost:3000 exhibits identical behavior
- Server logs show no errors: Only benign chart rendering warnings
- API is reachable:
curl commands to the API work (returns 404 for unknown endpoints, as expected)
Tested Variations
| Attempt |
Result |
BLINK_API_URL=https://erics-mac-mini.tail29e42.ts.net blink login |
Hangs |
BLINK_API_URL=http://localhost:3000 blink login |
Hangs |
blink deploy (triggers auth flow) |
Hangs |
| Restart blink-server, retry |
Hangs |
Hypothesis
The CLI appears to use polling or WebSocket to wait for the auth callback. Possible causes:
- Callback URL mismatch: The server may be constructing callback URLs that don't resolve correctly
- WebSocket/SSE not proxying through Tailscale Serve: Long-lived connections may not work through the proxy
- Session storage issue: Auth completes but session isn't persisted or retrievable by CLI
- Port/URL confusion:
BLINK_ACCESS_URL is HTTPS :443 but server listens on :3000
Workaround
blink dev works for local development (runs agent on host, not in container):
cd agent && OLLAMA_BASE_URL=http://localhost:11434/v1 blink dev
Additional Context
- Ollama is bound to localhost only (secure, not exposed on Tailscale)
- This setup is for a self-hosted Blink instance accessible only via Tailscale
Blink CLI Authentication Hangs After Browser Success
Summary
blink loginandblink deployhang indefinitely on "Waiting for authentication..." even after the browser-based auth flow completes successfully. No session/config file is created.Environment
Network Architecture
Blink Server Configuration
docker-compose.yaml
Tailscale Serve Configuration
Steps to Reproduce
Start the control plane:
Verify server is running:
curl https://erics-mac-mini.tail29e42.ts.net/ # Returns: /login (redirect)Attempt to authenticate:
export BLINK_API_URL=https://erics-mac-mini.tail29e42.ts.net blink loginBrowser opens to auth page, complete the flow → Browser shows "Success"
CLI remains stuck:
Observations
~/.config/blink/config.jsondoes not exist after authBLINK_API_URL=http://localhost:3000exhibits identical behaviorcurlcommands to the API work (returns 404 for unknown endpoints, as expected)Tested Variations
BLINK_API_URL=https://erics-mac-mini.tail29e42.ts.net blink loginBLINK_API_URL=http://localhost:3000 blink loginblink deploy(triggers auth flow)Hypothesis
The CLI appears to use polling or WebSocket to wait for the auth callback. Possible causes:
BLINK_ACCESS_URLis HTTPS :443 but server listens on :3000Workaround
blink devworks for local development (runs agent on host, not in container):Additional Context