Skip to content

docs(auth): clarify auth method copy for seat vs API key users - #37

Merged
marcusolsson merged 3 commits into
mainfrom
docs/auth-method-copy
Sep 3, 2026
Merged

marcusolsson merged 3 commits into
mainfrom
docs/auth-method-copy

Conversation

@marcusolsson

Copy link
Copy Markdown
Contributor

Summary

The /connect menu said "Login with Berget", which implied SSO was available to everyone — but OAuth requires a Berget Code seat. Users without a seat had to know to pick API keys instead. This makes the menu self-explanatory for both audiences.

Changes

Auth method labels (src/plugin.ts):

  • Login with BergetLog in with Berget AI (requires a Berget Code seat)
  • Enter Berget API Key manuallyUse a Berget AI API key

Docs updated to quote the new labels: README.md, CONTRIBUTING.md, docs/auth.md (including the mermaid diagram).

Fix (src/plugin/pkce-flow.ts): guard the PKCE authorization URL build — a malformed BERGET_API_URL now surfaces a clear error message instead of a raw TypeError: Invalid URL.

Chore: pre-existing import-sort lint error in auth.test.ts fixed via eslint --fix only (no logic change), so npm run lint is green.

Test plan

  • npm test — 58/58 pass (1 new test: invalid Keycloak URL rejects with clear error)
  • npm run typecheck, npm run lint — clean
  • prettier --check — clean
  • Manual: run opencode/connect → confirm both labels render fully (OAuth label is ~54 chars)

The 'Login with Berget' label implied SSO was available to all users,
but OAuth requires a Berget Code seat. Make the /connect menu
self-explanatory for both audiences:

- OAuth: 'Log in with Berget AI (requires a Berget Code seat)'
- API key: 'Use a Berget AI API key'

Also guard the PKCE authorization URL build so a malformed
BERGET_API_URL surfaces a clear error instead of a raw TypeError
(new regression test included).

Also fix a pre-existing import-sort lint error in auth.test.ts (eslint
--fix only, no logic change).
- 'Log in with Berget AI (requires a Berget Code seat)' → 'Use Berget Code seat'
- 'Use a Berget AI API key' → 'Use Berget AI API key'

Shorter labels also sidestep the truncation concern in the /connect menu.
@marcusolsson
marcusolsson merged commit 554d679 into main Sep 3, 2026
1 check passed
@marcusolsson
marcusolsson deleted the docs/auth-method-copy branch September 3, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant