Repository navigation
feat(setup): apps and AI assistants as an optional setup wizard step - #109
Merged
Merged
Conversation
The setup wizard gets an Apps and AI step: whether apps and AI assistants (MCP clients) may sign people in with their Lens account through OAuth, how long their tokens last, and the MCP server's address to copy. Skipping it keeps OAuth on, as before. New setting tokens.oauth_enabled (on by default; Settings -> API keys). Off, discovery answers 404, apps can't register, ask or renew, 401s stop naming resource metadata and lo_ tokens don't work; grants are kept, so turning it back on restores them, and people can still revoke them. API: PUT /api/v1/setup/oauth; GET /api/v1/setup reports oauth. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFiySoDnqG9PX5c3WLPz5C
Also sorts an import and formats two Fedora test files that main's pre-commit run (ruff, ruff format) rejects. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFiySoDnqG9PX5c3WLPz5C
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFiySoDnqG9PX5c3WLPz5C
Main's mypy run fails on deps._proxy_hosts (getaddrinfo's address tuple may hold an int); this makes CI pass here. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFiySoDnqG9PX5c3WLPz5C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before: OAuth sign-in for apps and MCP clients (#18) was always on. It had no place in the setup wizard and no switch.
After: the setup wizard has an optional Apps and AI step, placed between Storage and Telemetry. It asks whether apps and AI assistants (Claude, ChatGPT, Cursor and other MCP clients) may sign people in with their Lens account and how long their tokens last. It also shows the MCP server address with a Copy button. Skipping the step keeps OAuth on, as before. Admins can also flip the new switch in Settings → API keys.
How:
tokens.oauth_enabled, default true./.well-known/oauth-*returns 404, and register, authorize and token return 403. A 401 says a plainBearerwith no resource metadata, andlo_tokens stop working.GET /api/v1/setupnow reportsoauth, andPUT /api/v1/setup/oauthsaves it.Motivation and Context
Adeel asked for OAuth to be part of the setup wizard as an optional step.
Steps to reproduce (if appropriate):
cd fastapi_backend && uv run pytest tests/api/test_setup.py tests/api/test_oauth.py;cd nextjs-frontend && pnpm exec jest __tests__/setupWizard.test.tsx.Checked in a cloud container:
test_conversion.py::test_office_and_text_files_become_documents, which also fails on main there because of how LibreOffice is installed.deps.py:322, and main reports the same 3 there.Types of changes
Checklist:
🤖 Generated with Claude Code
https://claude.ai/code/session_01HFiySoDnqG9PX5c3WLPz5C
Generated by Claude Code