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>
# 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>
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.
No description provided.