[PR #6129] [CLOSED] fix(anonymous): improve user name generation logic and type assertion hooks.after AuthMiddleware #14713

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6129
Author: @rovertrack
Created: 11/20/2025
Status: Closed

Base: canaryHead: fix/optionaltypes1


📝 Commits (3)

  • a1b2692 fix(anonymous): improve user name generation logic and type assertion hooks.after AuthMiddleware
  • 4fb901d lint fixes
  • ea1131d Merge branch 'canary' into fix/optionaltypes1

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/anonymous/index.ts (+6 -2)

📄 Description

solves #6127


Summary by cubic

Improves anonymous user creation by safely generating names and tightening types in the after hook middleware. Fixes #6127.

  • Bug Fixes
    • Only call generateName when it’s a function; otherwise default to "Anonymous".
    • Assert the after hook as AuthMiddleware to resolve type issues.

Written for commit ea1131d2cd. 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/6129 **Author:** [@rovertrack](https://github.com/rovertrack) **Created:** 11/20/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `fix/optionaltypes1` --- ### 📝 Commits (3) - [`a1b2692`](https://github.com/better-auth/better-auth/commit/a1b2692fbeacedf4a9f72672361c8fcf5535937d) fix(anonymous): improve user name generation logic and type assertion hooks.after AuthMiddleware - [`4fb901d`](https://github.com/better-auth/better-auth/commit/4fb901d7a81e82fd23c83aa4f2cb6600700296ee) lint fixes - [`ea1131d`](https://github.com/better-auth/better-auth/commit/ea1131d2cd6bcab85894b8c77101f78b7786b66a) Merge branch 'canary' into fix/optionaltypes1 ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/anonymous/index.ts` (+6 -2) </details> ### 📄 Description solves #6127 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Improves anonymous user creation by safely generating names and tightening types in the after hook middleware. Fixes #6127. - **Bug Fixes** - Only call generateName when it’s a function; otherwise default to "Anonymous". - Assert the after hook as AuthMiddleware to resolve type issues. <sup>Written for commit ea1131d2cd6bcab85894b8c77101f78b7786b66a. 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:35:58 -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#14713