---
name: "Browser-based OAuth login flow from web UI and chat integrations"
---

# Story 406: Browser-based OAuth login flow from web UI and chat integrations

## User Story

As a new huskies user (or one whose refresh token has expired), I want to complete the full Claude OAuth login flow from the web UI, Matrix, or WhatsApp so that I don't need terminal access to run `claude login`.

## Acceptance Criteria

- [ ] From the web UI, the user can initiate OAuth login — huskies generates the Anthropic authorize URL and opens it in a new tab
- [ ] After the user authenticates in the browser, the OAuth callback writes accessToken, refreshToken, and expiresAt to ~/.claude/.credentials.json
- [ ] From Matrix or WhatsApp, huskies sends the user a clickable OAuth authorize link when credentials are missing or fully expired
- [ ] After successful login, the user can immediately start chatting without restarting huskies
- [ ] If the OAuth callback fails or the user cancels, a clear error is shown

## Out of Scope

- TBD
