[PR #852] [MERGED] feat: remove oslo and migrate to better-auth-utils for all crypto and encoding utils #3508

Closed
opened 2026-03-13 10:56:13 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/852
Author: @Bekacru
Created: 12/11/2024
Status: Merged
Merged: 12/17/2024
Merged by: @Bekacru

Base: mainHead: refactor/remove-oslo


📝 Commits (5)

  • 4853d8e fix: avoid returning the whole user object on email-otp verify
  • a52073c feat: remove oslo and migrate to better-auth-utils for all crypto and encdoing utils
  • 4f89362 Merge branch 'main' into refactor/remove-oslo
  • e1c4cef Merge branch 'main' into refactor/remove-oslo
  • 453824d chore: fix tests

📊 Changes

37 files changed (+343 additions, -734 deletions)

View changed files

📝 packages/better-auth/package.json (+1 -1)
📝 packages/better-auth/src/api/routes/account.test.ts (+2 -6)
📝 packages/better-auth/src/api/routes/email-verification.ts (+12 -14)
📝 packages/better-auth/src/api/routes/session.ts (+10 -7)
📝 packages/better-auth/src/api/routes/update-user.ts (+2 -2)
📝 packages/better-auth/src/cookies/index.ts (+17 -19)
packages/better-auth/src/crypto/base64.test.ts (+0 -77)
packages/better-auth/src/crypto/base64.ts (+0 -322)
📝 packages/better-auth/src/crypto/buffer.ts (+1 -1)
📝 packages/better-auth/src/crypto/hash.ts (+3 -30)
📝 packages/better-auth/src/crypto/index.ts (+3 -22)
packages/better-auth/src/crypto/jwt.ts (+15 -0)
📝 packages/better-auth/src/crypto/password.ts (+4 -4)
📝 packages/better-auth/src/crypto/random.ts (+7 -82)
📝 packages/better-auth/src/oauth2/state.ts (+3 -6)
📝 packages/better-auth/src/oauth2/utils.ts (+5 -7)
📝 packages/better-auth/src/plugins/anonymous/anon.test.ts (+2 -6)
📝 packages/better-auth/src/plugins/email-otp/index.ts (+7 -6)
📝 packages/better-auth/src/plugins/generic-oauth/index.ts (+2 -2)
📝 packages/better-auth/src/plugins/magic-link/index.ts (+2 -5)

...and 17 more files

📄 Description

Since the version of Oslo we use in Better Auth is about to reach end-of-life, we needed to migrate all utilized utilities elsewhere. We were considering using OsloJS (the new Oslo version), but it introduces separate packages for each implementation. which increases the amount of deps we rely on, which is fine but not ideal. And, most implementations in oslojs are written from scratch (we prefer sticking to web crypto impls.). For this we made our in house crypto and auth uility Better Auth Utils.

This PR aims to migrate all crypto and encoding implementations to better-auth-utils.

closes #674


🔄 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/852 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 12/11/2024 **Status:** ✅ Merged **Merged:** 12/17/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `refactor/remove-oslo` --- ### 📝 Commits (5) - [`4853d8e`](https://github.com/better-auth/better-auth/commit/4853d8e967d5f7009a61696521533114b9b1eb48) fix: avoid returning the whole user object on email-otp verify - [`a52073c`](https://github.com/better-auth/better-auth/commit/a52073c39a676a97c6be154e1f7363d948bf651f) feat: remove oslo and migrate to better-auth-utils for all crypto and encdoing utils - [`4f89362`](https://github.com/better-auth/better-auth/commit/4f89362fa17643e608b055bc7bb68bb6cef65da2) Merge branch 'main' into refactor/remove-oslo - [`e1c4cef`](https://github.com/better-auth/better-auth/commit/e1c4cef73129753c00d8a5911f2f6ba98f287d7a) Merge branch 'main' into refactor/remove-oslo - [`453824d`](https://github.com/better-auth/better-auth/commit/453824d617d2b4e16265d44317d561870afe0821) chore: fix tests ### 📊 Changes **37 files changed** (+343 additions, -734 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/package.json` (+1 -1) 📝 `packages/better-auth/src/api/routes/account.test.ts` (+2 -6) 📝 `packages/better-auth/src/api/routes/email-verification.ts` (+12 -14) 📝 `packages/better-auth/src/api/routes/session.ts` (+10 -7) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+2 -2) 📝 `packages/better-auth/src/cookies/index.ts` (+17 -19) ➖ `packages/better-auth/src/crypto/base64.test.ts` (+0 -77) ➖ `packages/better-auth/src/crypto/base64.ts` (+0 -322) 📝 `packages/better-auth/src/crypto/buffer.ts` (+1 -1) 📝 `packages/better-auth/src/crypto/hash.ts` (+3 -30) 📝 `packages/better-auth/src/crypto/index.ts` (+3 -22) ➕ `packages/better-auth/src/crypto/jwt.ts` (+15 -0) 📝 `packages/better-auth/src/crypto/password.ts` (+4 -4) 📝 `packages/better-auth/src/crypto/random.ts` (+7 -82) 📝 `packages/better-auth/src/oauth2/state.ts` (+3 -6) 📝 `packages/better-auth/src/oauth2/utils.ts` (+5 -7) 📝 `packages/better-auth/src/plugins/anonymous/anon.test.ts` (+2 -6) 📝 `packages/better-auth/src/plugins/email-otp/index.ts` (+7 -6) 📝 `packages/better-auth/src/plugins/generic-oauth/index.ts` (+2 -2) 📝 `packages/better-auth/src/plugins/magic-link/index.ts` (+2 -5) _...and 17 more files_ </details> ### 📄 Description Since the version of Oslo we use in Better Auth is about to reach end-of-life, we needed to migrate all utilized utilities elsewhere. We were considering using OsloJS (the new Oslo version), but it introduces separate packages for each implementation. which increases the amount of deps we rely on, which is fine but not ideal. And, most implementations in oslojs are written from scratch (we prefer sticking to web crypto impls.). For this we made our in house crypto and auth uility [Better Auth Utils](https://github.com/better-auth/utils). This PR aims to migrate all crypto and encoding implementations to **better-auth-utils**. closes #674 --- <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 10:56:14 -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#3508