Web viewer authentication for network exposure #7
Labels
No labels
good first issue
has-pr
help wanted
idea
priority
critical
priority
high
priority
low
priority
medium
status
blocked
status
in-progress
status
needs-review
status
ready
type
bug
type
docs
type
enhancement
type
feature
type
refactor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
customable/claude-mem#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
With
CLAUDE_MEM_WORKER_HOST=0.0.0.0, the Web Viewer is accessible to everyone on the network without authentication.Exposed data:
Solution: Token-based Auth
autogenerates a random token on first startImplementation
Migrated-From: jack/claude-mem-fork#74
This feature has been fully implemented in
src/services/server/middleware/auth.ts:CLAUDE_MEM_REMOTE_TOKENsetting for token configurationrequireScope()middlewareConfiguration:
Reopening - API token auth is implemented but Web UI needs:
The current Bearer token approach works for API clients but not for browser access.
Implementation Complete
The web viewer now has proper user-friendly authentication with a login page:
Features Added:
Login Page (
/login)/when auth is not required (localhost mode)Cookie-based Sessions
Auth Routes
GET /login- Login page HTMLPOST /api/auth/login- Authenticate with tokenPOST /api/auth/logout- Clear sessionGET /api/auth/status- Check auth statusLogout Button in UI
How it works:
CLAUDE_MEM_REMOTE_TOKENis configured):/redirect to/loginFiles Changed:
src/services/server/middleware/auth.ts- Session management functionssrc/services/worker/http/middleware.ts- Added cookie-parsersrc/services/worker/http/routes/AuthRoutes.ts- New auth routessrc/services/worker-service.ts- Register auth routessrc/ui/viewer/layouts/Topbar/TopbarActions.tsx- Logout button