Skip to content

Reverted SingleUseTokenProvider TypeScript conversion#28373

Merged
kevinansfield merged 1 commit into
mainfrom
revert-single-use-token-provider-ts
Jun 4, 2026
Merged

Reverted SingleUseTokenProvider TypeScript conversion#28373
kevinansfield merged 1 commit into
mainfrom
revert-single-use-token-provider-ts

Conversation

@kevinansfield
Copy link
Copy Markdown
Member

@kevinansfield kevinansfield commented Jun 4, 2026

ref https://app.incident.io/ghost/incidents/298

Summary

no issue

The TypeScript version requires tsx in job runtime contexts where the package is not available, causing scheduled jobs to fail during module loading.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

Walkthrough

This PR migrates the SingleUseTokenProvider from a TypeScript implementation to JavaScript, removes the members_otc_secret configuration parameter from all service instantiation points, and cleans up TypeScript-related worker-thread flags from the job service. The JavaScript implementation provides the same public API and functionality (token creation/validation, HOTP-based OTC generation/verification, HMAC-SHA256 OTC verification hashes, usage and lifetime enforcement, and database-level locking during validation). All consuming services and tests are updated to match the new import export style and removed secret parameter.

Possibly related PRs

  • TryGhost/Ghost#25151: Earlier PR that introduced the TypeScript SingleUseTokenProvider and Bree TypeScript worker flags that this PR reverses.

Suggested reviewers

  • allouis
  • EvanHahn
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: reverting a TypeScript conversion of SingleUseTokenProvider back to JavaScript implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description is directly related to the changeset, clearly referencing a revert of a previous commit and explaining the rationale for restoring the JS implementation and removing the TS version due to job runtime failures.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-single-use-token-provider-ts

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevinansfield kevinansfield enabled auto-merge (squash) June 4, 2026 17:31
@kevinansfield kevinansfield merged commit c68bbdb into main Jun 4, 2026
50 checks passed
@kevinansfield kevinansfield deleted the revert-single-use-token-provider-ts branch June 4, 2026 17:50
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