[PR #4620] [MERGED] fix(expo): window.crypto is undefined #5488

Closed
opened 2026-03-13 12:24:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4620
Author: @himself65
Created: 9/12/2025
Status: Merged
Merged: 9/12/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/09/12/crypto-2


📝 Commits (3)

  • 9106083 fix(expo): window.crypto is undefined
  • d7d5b12 fix(expo): window.crypto is undefined
  • 8d9d247 fix(expo): window.crypto is undefined

📊 Changes

6 files changed (+17 additions, -18 deletions)

View changed files

📝 packages/better-auth/package.json (+1 -1)
📝 packages/better-auth/src/crypto/password.ts (+1 -2)
📝 packages/better-auth/src/plugins/device-authorization/index.ts (+1 -2)
📝 packages/better-auth/src/plugins/jwt/utils.ts (+5 -4)
📝 packages/better-auth/src/plugins/mcp/index.ts (+2 -2)
📝 pnpm-lock.yaml (+7 -7)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/4471

There's no polyfill for crypto.getRandomValues. So think we just leave the code as-is

Summary by cubic

Fixes a crash in Expo where window.crypto is undefined by upgrading @better-auth/utils to 0.3.0. This version avoids relying on window.crypto, restoring compatibility in React Native/Expo; lockfile updated.


🔄 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/4620 **Author:** [@himself65](https://github.com/himself65) **Created:** 9/12/2025 **Status:** ✅ Merged **Merged:** 9/12/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/09/12/crypto-2` --- ### 📝 Commits (3) - [`9106083`](https://github.com/better-auth/better-auth/commit/910608357d93af04854a646a43dc9ca25feb5e9c) fix(expo): `window.crypto` is undefined - [`d7d5b12`](https://github.com/better-auth/better-auth/commit/d7d5b121d388856239b9872780477b8bd75fa3c5) fix(expo): `window.crypto` is undefined - [`8d9d247`](https://github.com/better-auth/better-auth/commit/8d9d247f62c5116f709095316665bee041e7d143) fix(expo): `window.crypto` is undefined ### 📊 Changes **6 files changed** (+17 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+1 -1) 📝 `packages/better-auth/src/crypto/password.ts` (+1 -2) 📝 `packages/better-auth/src/plugins/device-authorization/index.ts` (+1 -2) 📝 `packages/better-auth/src/plugins/jwt/utils.ts` (+5 -4) 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+2 -2) 📝 `pnpm-lock.yaml` (+7 -7) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/4471 There's no polyfill for `crypto.getRandomValues`. So think we just leave the code as-is <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fixes a crash in Expo where window.crypto is undefined by upgrading @better-auth/utils to 0.3.0. This version avoids relying on window.crypto, restoring compatibility in React Native/Expo; lockfile updated. <!-- End of auto-generated description by cubic. --> --- <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-03-13 12:24:41 -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#5488