Repository navigation
Link to /login/github, and let the wizard report its own failures - #12
Merged
Merged
Conversation
Two fixes landing with goblog #631 and #632. The GitHub button used to assemble the authorize URL here, with window.location concatenated straight into redirect_uri; a next containing & ended the value early and the rest reached GitHub as further authorize parameters. goblog builds the URL now, so this is a plain anchor at /login/github carrying an escaped next — no client_id in the page and no inline script. wizard_db.html read data.responseJSON.error in its AJAX error handler. responseJSON is undefined whenever the body was not JSON — a proxy error, an HTML error page, a dropped connection — so reading .error threw: the button went red and the reason never appeared, which is the one thing someone stuck on that step needs. It falls back through statusText now, and renders with .text() rather than .html(). Needs goblog with #631 for the /login/github route. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It has an explicit external dependency on a backend route shipping first (/login/github), and I can’t verify release/merge sequencing correctness from this repo alone.
Review effort: Lite
Findings: None
What changed in this PR
Updates the theme’s GitHub login entrypoint to rely on the new server-side /login/github route (avoiding client-side OAuth URL construction and redirect URI injection issues), and improves the DB wizard’s AJAX error reporting so failures are reliably surfaced to the user.
Changes:
- Replace the GitHub login button’s client-side OAuth URL assembly with a plain anchor to
/login/github(optionally including anextquery param). - Make the DB test wizard’s AJAX error handler resilient when the response body is not JSON, and render the message safely via
.text().
| File | Description |
|---|---|
| templates/login.html | Switches GitHub login button to link to /login/github with optional next parameter; removes inline JS that built the GitHub authorize URL. |
| templates/wizard_db.html | Hardens AJAX error handling when responseJSON is absent and avoids HTML injection by using .text(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
goblog exchanges the code at /login itself, against a state it minted, so this block can never fire (goblog #637). It was also the client half of the login CSRF: it posted whatever code appeared in the query to /api/login, which no longer exists. That was all this script did in this theme, so the element goes with it; this theme has no email login to keep. Needs goblog with #637. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
compscidr
force-pushed
the
fix/631-login-github
branch
from
September 25, 2026 20:20
153d195 to
c25128c
Compare
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.
Lands with goblogplatform/GoBlog#636.
Why
The GitHub button assembled GitHub's authorize URL here, with
window.locationconcatenated straight intoredirect_uri. Anextcontaining&ended the value early and everything after it reached GitHub as further authorize parameters (goblogplatform/GoBlog#631).goblog builds the URL now, so this becomes a plain anchor:
No
client_idin the page, no inline script, and the escaping is tested once in Go instead of duplicated across four theme repos.goblogplatform/GoBlog#636 must merge and release first.
/login/githubdoes not exist until it ships; on an older goblog this link 404s and GitHub login is dead.This is the reverse of the #624 round, where the themes went first — there they had to tolerate a goblog change, here they depend on a new route.
Also now: the ?code= block goes
goblog exchanges the code at
/loginitself, against a state it minted, so that block can never fire (goblogplatform/GoBlog#637). It was also the client half of a login CSRF: it posted whatever code appeared in the query to/api/login, which no longer exists.Updated requirement: needs goblog with #638 (which includes #636).
🤖 Generated with Claude Code
Also in this theme
wizard_db.htmlreaddata.responseJSON.errorin its AJAX error handler.responseJSONis undefined whenever the body was not JSON — a proxy error, an HTML error page, a dropped connection — so reading.errorthrew: the button went red and the reason never appeared. It falls back throughstatusTextnow, and renders with.text()rather than.html()(goblogplatform/GoBlog#632).Note for the deploy: iac clones this theme at
main, so merging this before goblog #636 is released would break goblog.live's GitHub login on the next playbook run, even one for an unrelated reason.