Skip to content

fix(sdk): the back-channel logout log says why the form was rejected - #699

Draft
PiquelChips wants to merge 2 commits into
mainfrom
fix/sdk-logout-form-cause
Draft

PiquelChips wants to merge 2 commits into
mainfrom
fix/sdk-logout-form-cause

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Part of #544 (NEW-17, the Rust SDK's back-channel logout).

The Rust SDK's POST /backchannel-logout route (the axum feature) passed form.ok() on, which dropped the FormRejection. So every rejected form was logged as back-channel logout without a logout_token form field, even one that had the field but the wrong Content-Type or an unreadable body. The route now passes the Result on and logs the rejection. It logs with Display (error = %rejection), as apps/auth-service/src/web/account.rs does: axum's rejection text already ends with its inner error, which is also its source(), so ErrorChain would print the cause twice.

Changed log

Level Before After
warn back-channel logout without a logout_token form field (no fields) back-channel logout form rejected, with error = %rejection, e.g. Form requests must have `Content-Type: application/x-www-form-urlencoded` or Failed to deserialize form body: missing field `logout_token`

Unchanged

  • The response: still 400 {"error":"invalid_request"} with Cache-Control: no-store, and still 404 first when no logout handler is mounted.
  • The public API: receive_logout is private. cargo semver-checks -p sourceorigin-auth --baseline-rev origin/main says no semver update is required.
  • The TypeScript SDK, which has no such log.

Checks

  • cargo clippy --locked -p sourceorigin-auth --all-targets -- -D warnings, with and without --all-features
  • RUSTDOCFLAGS='-D warnings' cargo doc --locked --no-deps --all-features -p sourceorigin-auth, and cargo test --doc --all-features: 48 passed
  • cargo nextest run -p sourceorigin-auth --all-features: 48 passed. compile_fail::type_mistakes_do_not_compile was run apart with cargo test --test compile_fail and passes (30 s). Under nextest it once timed out at 300 s, building its trybuild crate from cold on CARGO_BUILD_JOBS=3.
  • cargo semver-checks: 202 checks pass

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 (via T3 Code)

The route passed form.ok() on, so every rejection, such as a wrong content
type, was logged as a missing logout_token field. It now logs the
FormRejection's chain.
@PiquelChips PiquelChips added bug Something isn't working sdk Rust and TypeScript SDKs labels Nov 22, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 22, 2026
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Review follow-up: axum's rejection text already ends with its cause, which
is also its source, so ErrorChain repeated it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sdk Rust and TypeScript SDKs

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant