Skip to content

fix(auth): preserve OTP email and code as JSON string values - #905

Closed
Gajesh2007 wants to merge 1 commit into
masterfrom
fix/privy-otp-json
Closed

Gajesh2007 wants to merge 1 commit into
masterfrom
fix/privy-otp-json

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Privy OTP requests interpolated the email and code directly into JSON. Quotes and backslashes could make the request invalid or add fields. Serialize typed string fields for both OTP operations, preserving the ordinary request bytes, authentication headers, endpoints, and response/error handling.

Before:

flowchart LR
  A[Admin email login] --> B[InitEmailOTP or VerifyEmailOTP]
  B --> C[Interpolate email and code into JSON]
  C --> D[Quoted or escaped input breaks JSON or adds fields]
  C --> E[Plain input sent to Privy]
Loading

After:

flowchart LR
  A[Admin email login] --> B[InitEmailOTP or VerifyEmailOTP]
  B --> C[Marshal typed email and code string fields]
  C --> D[Valid JSON with original string values]
  D --> E[Same Privy endpoint and response handling]
Loading

Validation: the new transport-level regression test fails on the previous implementation for quoted addresses, escape/control characters, and attempted field injection in both operations. GOTOOLCHAIN=go1.25.0 go test -race ./coordinator/auth -count=1 passes after the fix. Ordinary request bytes are explicitly checked. scripts/docs-check.sh --all passes (277 documents); git diff --check passes. The new-branch pre-push hook did not select a diff range; validation above was run explicitly.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
d-inference Ready Ready Preview Sep 11, 2026 11:27pm UTC
d-inference-console-ui-dev Ready Ready Preview Sep 11, 2026 11:27pm UTC
d-inference-landing Ready Ready Preview Sep 11, 2026 11:27pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-11T23:31:09.180824Z 25f4bae Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 25f4baebd9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Gajesh2007

Copy link
Copy Markdown
Member Author

Consolidated into #1095 for review and merge into master. That PR contains this branch's exact head (25f4bae), including its review fixes. Closing this smaller PR to collapse the stack; the branch and review history are retained. Follow #1095 for combined validation and merge status.

@Gajesh2007 Gajesh2007 closed this Sep 16, 2026

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference — 25f4baeb Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference-console-ui-dev — 25f4baeb Deployed Sep 11, 2026 by vercel[bot]
Preview – d-inference-landing — 25f4baeb Deployed Sep 11, 2026 by vercel[bot]
benchmarks — 25f4baeb Deployed Sep 11, 2026 by Gajesh2007 via E2E Benchmarks #947
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant