Skip to content

feat(otp): support raw byte secrets - #39

Merged
bytaesu merged 5 commits into
better-auth:mainfrom
fireph:feat/otp-byte-secrets
Oct 24, 2026
Merged

bytaesu merged 5 commits into
better-auth:mainfrom
fireph:feat/otp-byte-secrets

Conversation

@fireph

@fireph fireph commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Support raw byte secrets in createOTP so base32 secrets can be decoded and used for HOTP/TOTP without changing the underlying key. Existing string secrets retain their UTF-8 behavior.

This change is needed for better-auth/better-auth#12010 (and utils dependency with have to be updated on better-auth next after this is merged).

@fireph
fireph marked this pull request as ready for review October 23, 2026 22:38
@fireph
fireph force-pushed the feat/otp-byte-secrets branch from f888417 to 2831064 Compare October 23, 2026 22:40
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds raw byte secrets to createOTP while keeping existing strings as UTF-8.

  • HOTP and TOTP can use raw byte secrets without changing their key bytes.

Reviews (5) · Last reviewed commit: "Update README.md" · Reviewed by Greptile

@fireph
fireph force-pushed the feat/otp-byte-secrets branch from 2831064 to 7bbbcc1 Compare October 23, 2026 23:07
Comment thread README.md Resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@bytaesu
bytaesu merged commit 8a35595 into better-auth:main Oct 24, 2026
1 check passed
@bytaesu

bytaesu commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

@holistis I added you as a co-author on this PR

@bytaesu bytaesu mentioned this pull request Oct 24, 2026
brandhaug added a commit to brandhaug/b2b-saas-starter that referenced this pull request Oct 28, 2026
## pnpm-workspace.yaml (default)

## Dependency Updates

| Package | From | To | Type |
| --- | --- | --- | --- |
| `@better-auth/utils` | 0.5.0 | 0.5.1 | patch |
| `ai` | 7.0.152 | 7.0.153 | patch |

## Release Notes

<details>
<summary><b>@<!---->better-auth/utils</b> (0.5.0 → 0.5.1)</summary>

### &nbsp;&nbsp;&nbsp;🚀 Features

- **otp**: Support raw byte secrets &nbsp;-&nbsp; by @<!---->fireph in
better-auth/utils#39
[<samp>(8a355)</samp>](better-auth/utils@8a35595)

##### &nbsp;&nbsp;&nbsp;&nbsp;[View changes on
GitHub](better-auth/utils@v0.5.0...v0.5.1)

</details>

---
*This PR was auto-generated by
[catalog-update-action](https://github.com/brandhaug/catalog-update-action).*

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

2 participants