Skip to content

Migrate to new simpleauth#481

Open
mtlynch wants to merge 47 commits intomasterfrom
new-simpleauth
Open

Migrate to new simpleauth#481
mtlynch wants to merge 47 commits intomasterfrom
new-simpleauth

Conversation

@mtlynch
Copy link
Copy Markdown
Owner

@mtlynch mtlynch commented Apr 19, 2026

No description provided.

mtlynch and others added 25 commits April 19, 2026 19:07
simpleauth v3 stores only UserID in sessions (not Username/IsAdmin),
requiring database lookups to reconstruct user info. This change adds
dev-mode auth cookies to carry username and admin state without extra
DB roundtrips, adds per-session database isolation for e2e tests, and
fixes Playwright setup to supply required env vars and wait robustly
for the server before running tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These changes were debugging artifacts (sleep-based workarounds) that
are not necessary for the simpleauth v3 migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The ncruces/go-sqlite3 WASM driver does not implement cache=shared for
in-memory databases: each new pool connection gets an empty database
rather than sharing the named one. This caused "no such table: users"
errors when concurrent browser requests hit different connections.

Limiting to one open connection ensures every query uses the same
underlying in-memory database.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The dev auth cookie (dev-is-admin) existed to work around a mismatch
where sessions lived in the shared database while user data lived in
per-session databases. This made the session manager's DB resolver
context-aware so sessions are stored in the same per-session database
as application data, eliminating the two-database problem entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mtlynch and others added 18 commits April 26, 2026 11:57
# Conflicts:
#	cmd/screenjournal/main.go
#	handlers/account_test.go
#	handlers/auth_test.go
#	handlers/comments_test.go
#	handlers/invites_test.go
#	handlers/password_reset_routes_test.go
#	handlers/password_reset_test.go
#	handlers/reactions_test.go
#	handlers/reviews_test.go
#	handlers/search_test.go
#	handlers/server.go
#	handlers/users_test.go
# Conflicts:
#	handlers/db_dev.go
#	handlers/server.go
# Conflicts:
#	handlers/db_dev.go
#	handlers/db_prod.go
Session methods are now on Store directly (like every other method in
the package) and reuse the existing RFC3339 time format helpers instead
of defining a custom datetime format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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