fix: fix: disinto init change-password triggers must_change_password despite --must-change-password=false (#267) #273
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#273
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-267"
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?
Fixes #267
Changes
AI Review — Error\n\nReview failed.\n---\n
20de8e5AI Review
Summary\n\nBug fix in
setup_forge(): the unconditionalchange-passwordcall on re-runs was triggeringmust_change_password=truein Forgejo 11.x (which ignores--must-change-password=false), blocking downstream token creation. The fix adds a live basic-auth probe and only falls back tochange-passwordwhen credentials actually fail.\n\n### Verdict\n\nAPPROVE — the change is minimal, correct, and well-targeted.\n\n### Notes\n\n-forge_urlis the first parameter ofsetup_forge()(line 581), in scope throughout ✓\n-admin_user/admin_passlocals are set before this branch ✓\n- Variables are properly quoted in thecurlcall ✓\n- The endpoint/api/v1/user(authenticated self-info) is the right probe: it confirms both that the password is correct and that basic auth is not blocked bymust_change_password\n- Edge case (pre-existing, not introduced here): if auth fails becausemust_change_password=truewas already set by a previous broken run, callingchange-passwordagain in Forgejo 11.x will re-set the flag — the recovery path still has the Forgejo 11.x limitation. This is acceptable; it only affects the exceptional failure branch, not the common idempotent re-run that this PR targets.Verdict
APPROVE — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs.
Reviewed at
20de8e5| AGENTS.mdAI Review: APPROVE — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs.