[PR #1523] [MERGED] feat: base64 conversion without Buffer #29444

Closed
opened 2026-04-17 20:46:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1523
Author: @BlankParticle
Created: 2/21/2025
Status: Merged
Merged: 2/22/2025
Merged by: @Bekacru

Base: v1.2Head: feat/bufferless-base64


📝 Commits (2)

  • 28cc66b fix(organizaiton): restrict admins from removing or updating owners or members with creator roles (#1520)
  • c13d0a2 feat: base64 conversion without Buffer

📊 Changes

9 files changed (+114 additions, -50 deletions)

View changed files

📝 packages/better-auth/src/crypto/hash.ts (+3 -2)
📝 packages/better-auth/src/crypto/password.ts (+2 -1)
📝 packages/better-auth/src/plugins/jwt/utils.ts (+5 -8)
📝 packages/better-auth/src/plugins/organization/organization.test.ts (+35 -1)
📝 packages/better-auth/src/plugins/organization/routes/crud-members.ts (+54 -25)
📝 packages/better-auth/src/plugins/passkey/index.ts (+5 -6)
📝 packages/better-auth/src/plugins/two-factor/backup-codes/index.ts (+5 -3)
📝 packages/better-auth/src/social-providers/microsoft-entra-id.ts (+2 -2)
📝 packages/better-auth/src/social-providers/reddit.ts (+3 -2)

📄 Description

BetterAuth doesn't work on cloudflare workers without nodejs_compact flags due to usage of Buffer to do base64 encoding/decoding.
This PR replaces all Buffer usage with base64 from @better-auth/utils/base64 and TextEncoder/TextDecoder.

There will be a follow up PR to add a cloudflare worker example and test suite to make sure workerd compatibly doesn't break in future.
Follow up #1524

fixes #1375


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/1523 **Author:** [@BlankParticle](https://github.com/BlankParticle) **Created:** 2/21/2025 **Status:** ✅ Merged **Merged:** 2/22/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `v1.2` ← **Head:** `feat/bufferless-base64` --- ### 📝 Commits (2) - [`28cc66b`](https://github.com/better-auth/better-auth/commit/28cc66bff73a5c360cf17f20d5e6ea2d989d5615) fix(organizaiton): restrict admins from removing or updating owners or members with creator roles (#1520) - [`c13d0a2`](https://github.com/better-auth/better-auth/commit/c13d0a2743830d16a3cae3fbc32201f47ed00e4c) feat: base64 conversion without Buffer ### 📊 Changes **9 files changed** (+114 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/crypto/hash.ts` (+3 -2) 📝 `packages/better-auth/src/crypto/password.ts` (+2 -1) 📝 `packages/better-auth/src/plugins/jwt/utils.ts` (+5 -8) 📝 `packages/better-auth/src/plugins/organization/organization.test.ts` (+35 -1) 📝 `packages/better-auth/src/plugins/organization/routes/crud-members.ts` (+54 -25) 📝 `packages/better-auth/src/plugins/passkey/index.ts` (+5 -6) 📝 `packages/better-auth/src/plugins/two-factor/backup-codes/index.ts` (+5 -3) 📝 `packages/better-auth/src/social-providers/microsoft-entra-id.ts` (+2 -2) 📝 `packages/better-auth/src/social-providers/reddit.ts` (+3 -2) </details> ### 📄 Description BetterAuth doesn't work on cloudflare workers without `nodejs_compact` flags due to usage of `Buffer` to do base64 encoding/decoding. This PR replaces all `Buffer` usage with `base64` from `@better-auth/utils/base64` and `TextEncoder`/`TextDecoder`. ~~There will be a follow up PR to add a cloudflare worker example and test suite to make sure workerd compatibly doesn't break in future.~~ Follow up #1524 fixes #1375 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 20:46:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#29444