[PR #6140] [MERGED] chore: use generate random string helper #14722

Closed
opened 2026-04-13 09:36:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6140
Author: @Bekacru
Created: 11/20/2025
Status: Merged
Merged: 11/20/2025
Merged by: @himself65

Base: canaryHead: refactor/api-key


📝 Commits (1)

  • f612242 chore: use generate random string helper

📊 Changes

1 file changed (+3 additions, -8 deletions)

View changed files

📝 packages/better-auth/src/plugins/api-key/index.ts (+3 -8)

📄 Description

Summary by cubic

Switched API key generation to use the shared generateRandomString helper. This improves consistency and randomness while keeping prefix behavior unchanged.

  • Refactors
    • Replaced the custom character loop with generateRandomString ("a-z", "A-Z") in the default key generator.

Written for commit f6122429b5. Summary will update automatically on new commits.


🔄 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/6140 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 11/20/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `refactor/api-key` --- ### 📝 Commits (1) - [`f612242`](https://github.com/better-auth/better-auth/commit/f6122429b5fc7edcb8cc1b58387f5ee972b3a527) chore: use generate random string helper ### 📊 Changes **1 file changed** (+3 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/api-key/index.ts` (+3 -8) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Switched API key generation to use the shared generateRandomString helper. This improves consistency and randomness while keeping prefix behavior unchanged. - **Refactors** - Replaced the custom character loop with generateRandomString ("a-z", "A-Z") in the default key generator. <sup>Written for commit f6122429b5fc7edcb8cc1b58387f5ee972b3a527. Summary will update automatically on new commits.</sup> <!-- 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-04-13 09:36:11 -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#14722