Migrate to new simpleauth#481
Merged
Merged
Conversation
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
added a commit
that referenced
this pull request
May 3, 2026
Previously, we had a mechanism in the debug built of the app to load per-request databases. This pulls this behavior out of the app and makes test isolation Playwright's job instead. When we got to #481, there was just too much complexity to the per-request DB and it was making request handling for auth too complicated. It's simpler if we don't have to bend the app to satisfy the test isolation goal. This implementation starts one dev server per Playwright worker and restarts it with a fresh SQLite database for each test so e2e isolation no longer depends on app-level per-session DB routing.
# Conflicts: # handlers/auth.go # handlers/db_dev.go # handlers/password_reset.go
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.