[PR #2552] [MERGED] feat: add an option to encrypt tokens by default #21274

Closed
opened 2026-04-15 20:14:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2552
Author: @Bekacru
Created: 5/6/2025
Status: Merged
Merged: 7/18/2025
Merged by: @Bekacru

Base: v1.3Head: feat/encrypted-accounts


📝 Commits (9)

  • e36f2eb feat: add an option to encrypt tokens by default
  • a3847b0 Merge branch 'v1.3' into feat/encrypted-accounts
  • 73406c9 feat(auth): add OAuth token encryption support
  • b3f9670 refactor(auth): streamline token handling in OAuth callback by utilizing setTokenUtil
  • 33b3926 refactor(auth): replace direct token handling with setTokenUtil for improved clarity and maintainability
  • 28fbd09 refactor(auth): unify token handling by utilizing setTokenUtil for access and refresh tokens
  • 6989a48 docs(auth): enhance documentation for OAuth token encryption, clarifying security risks and benefits
  • c0c8e1c chore: cleanup
  • 7d19568 update test

📊 Changes

9 files changed (+96 additions, -24 deletions)

View changed files

📝 docs/content/docs/reference/options.mdx (+5 -0)
📝 packages/better-auth/src/api/routes/account.test.ts (+10 -1)
📝 packages/better-auth/src/api/routes/account.ts (+15 -11)
📝 packages/better-auth/src/api/routes/callback.ts (+5 -3)
📝 packages/better-auth/src/oauth2/link-account.ts (+7 -6)
📝 packages/better-auth/src/oauth2/utils.ts (+25 -0)
📝 packages/better-auth/src/plugins/sso/index.ts (+9 -2)
📝 packages/better-auth/src/social-providers/roblox.ts (+0 -1)
📝 packages/better-auth/src/types/options.ts (+20 -0)

📄 Description

closes #2181


🔄 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/2552 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 7/18/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `v1.3` ← **Head:** `feat/encrypted-accounts` --- ### 📝 Commits (9) - [`e36f2eb`](https://github.com/better-auth/better-auth/commit/e36f2ebbf7f0a73af72e449e7977b2bd3bd0403e) feat: add an option to encrypt tokens by default - [`a3847b0`](https://github.com/better-auth/better-auth/commit/a3847b0694e8892dccbe3aa561293bf973ea8a75) Merge branch 'v1.3' into feat/encrypted-accounts - [`73406c9`](https://github.com/better-auth/better-auth/commit/73406c9d3ee5a113d21a654fd4a8c0b0de30eb76) feat(auth): add OAuth token encryption support - [`b3f9670`](https://github.com/better-auth/better-auth/commit/b3f96708ea769d86ae363f1f55332882ebd4cc04) refactor(auth): streamline token handling in OAuth callback by utilizing setTokenUtil - [`33b3926`](https://github.com/better-auth/better-auth/commit/33b3926806b84145fbb877359a093a2369e6cc6c) refactor(auth): replace direct token handling with setTokenUtil for improved clarity and maintainability - [`28fbd09`](https://github.com/better-auth/better-auth/commit/28fbd0910cbe28e943996995473b2986b0fc1c61) refactor(auth): unify token handling by utilizing setTokenUtil for access and refresh tokens - [`6989a48`](https://github.com/better-auth/better-auth/commit/6989a48c1a9965ea77a69f7e6d9a156d4c260930) docs(auth): enhance documentation for OAuth token encryption, clarifying security risks and benefits - [`c0c8e1c`](https://github.com/better-auth/better-auth/commit/c0c8e1cb636694f11acdcdd57e23fe4fb8695d0b) chore: cleanup - [`7d19568`](https://github.com/better-auth/better-auth/commit/7d19568f7117628bc540ed7bce49ff278e7e2d9a) update test ### 📊 Changes **9 files changed** (+96 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/reference/options.mdx` (+5 -0) 📝 `packages/better-auth/src/api/routes/account.test.ts` (+10 -1) 📝 `packages/better-auth/src/api/routes/account.ts` (+15 -11) 📝 `packages/better-auth/src/api/routes/callback.ts` (+5 -3) 📝 `packages/better-auth/src/oauth2/link-account.ts` (+7 -6) 📝 `packages/better-auth/src/oauth2/utils.ts` (+25 -0) 📝 `packages/better-auth/src/plugins/sso/index.ts` (+9 -2) 📝 `packages/better-auth/src/social-providers/roblox.ts` (+0 -1) 📝 `packages/better-auth/src/types/options.ts` (+20 -0) </details> ### 📄 Description closes #2181 --- <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-15 20:14:53 -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#21274