[PR #358] [MERGED] refactor: remove user prefix from endpoints #28851

Closed
opened 2026-04-17 20:18:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/358
Author: @Bekacru
Created: 10/28/2024
Status: Merged
Merged: 10/28/2024
Merged by: @Bekacru

Base: mainHead: refactor/remove-user-prefixed-endpoints


📝 Commits (4)

  • 57efef1 reafctor: remove user prefix from endpoints
  • 8013201 chore: update docs and exmaples
  • 3dac9a2 chore: update docs and exmaples
  • f6af0df chore: update docs and exmaples

📊 Changes

23 files changed (+68 additions, -75 deletions)

View changed files

📝 demo/nextjs/app/dashboard/user-card.tsx (+4 -4)
📝 demo/nextjs/lib/auth-client.ts (+0 -1)
📝 docs/content/docs/concepts/session-management.mdx (+4 -4)
📝 docs/content/docs/concepts/users-accounts.mdx (+6 -6)
📝 docs/content/docs/plugins/bearer.mdx (+2 -2)
📝 examples/astro-example/src/components/user-card.tsx (+5 -10)
📝 examples/astro-example/src/libs/auth-client.ts (+4 -1)
📝 examples/nextjs-example/app/dashboard/user-card.tsx (+3 -3)
📝 examples/remix-example/app/components/user-card.tsx (+4 -5)
📝 packages/better-auth/src/api/routes/account.test.ts (+4 -4)
📝 packages/better-auth/src/api/routes/account.ts (+4 -7)
📝 packages/better-auth/src/api/routes/session.test.ts (+4 -4)
📝 packages/better-auth/src/api/routes/session.ts (+3 -3)
📝 packages/better-auth/src/api/routes/update-user.test.ts (+6 -6)
📝 packages/better-auth/src/api/routes/update-user.ts (+6 -6)
📝 packages/better-auth/src/client/config.ts (+2 -2)
📝 packages/better-auth/src/client/path-to-object.ts (+1 -1)
📝 packages/better-auth/src/db/db.test.ts (+1 -1)
📝 packages/better-auth/src/plugins/additional-fields/additional-fields.test.ts (+1 -1)
📝 packages/better-auth/src/plugins/admin/index.ts (+1 -1)

...and 3 more files

📄 Description

The /user prefix in the client can lead to confusion because "user" is a term used in multiple contexts, alos it makes it difficult to destructure the client objec. To resolve this, this PR removes the /user prefix from the URLs. For instance, the endpoint /user/update will now be changed to /update-user.

  • change endpoints
  • update tests
  • update docs
  • update examples

🔄 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/358 **Author:** [@Bekacru](https://github.com/Bekacru) **Created:** 10/28/2024 **Status:** ✅ Merged **Merged:** 10/28/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `refactor/remove-user-prefixed-endpoints` --- ### 📝 Commits (4) - [`57efef1`](https://github.com/better-auth/better-auth/commit/57efef1ce9811784db5b9b57158ad0e2a0e95cd6) reafctor: remove user prefix from endpoints - [`8013201`](https://github.com/better-auth/better-auth/commit/8013201008d3d63de1296e2b6bde58844f9f1251) chore: update docs and exmaples - [`3dac9a2`](https://github.com/better-auth/better-auth/commit/3dac9a2dced663e24c54e669eef6e7152b2aecfe) chore: update docs and exmaples - [`f6af0df`](https://github.com/better-auth/better-auth/commit/f6af0df4ffaac26fe19fbd2531dff9c7dec78689) chore: update docs and exmaples ### 📊 Changes **23 files changed** (+68 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `demo/nextjs/app/dashboard/user-card.tsx` (+4 -4) 📝 `demo/nextjs/lib/auth-client.ts` (+0 -1) 📝 `docs/content/docs/concepts/session-management.mdx` (+4 -4) 📝 `docs/content/docs/concepts/users-accounts.mdx` (+6 -6) 📝 `docs/content/docs/plugins/bearer.mdx` (+2 -2) 📝 `examples/astro-example/src/components/user-card.tsx` (+5 -10) 📝 `examples/astro-example/src/libs/auth-client.ts` (+4 -1) 📝 `examples/nextjs-example/app/dashboard/user-card.tsx` (+3 -3) 📝 `examples/remix-example/app/components/user-card.tsx` (+4 -5) 📝 `packages/better-auth/src/api/routes/account.test.ts` (+4 -4) 📝 `packages/better-auth/src/api/routes/account.ts` (+4 -7) 📝 `packages/better-auth/src/api/routes/session.test.ts` (+4 -4) 📝 `packages/better-auth/src/api/routes/session.ts` (+3 -3) 📝 `packages/better-auth/src/api/routes/update-user.test.ts` (+6 -6) 📝 `packages/better-auth/src/api/routes/update-user.ts` (+6 -6) 📝 `packages/better-auth/src/client/config.ts` (+2 -2) 📝 `packages/better-auth/src/client/path-to-object.ts` (+1 -1) 📝 `packages/better-auth/src/db/db.test.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/additional-fields/additional-fields.test.ts` (+1 -1) 📝 `packages/better-auth/src/plugins/admin/index.ts` (+1 -1) _...and 3 more files_ </details> ### 📄 Description The `/user` prefix in the client can lead to confusion because "user" is a term used in multiple contexts, alos it makes it difficult to destructure the client objec. To resolve this, this PR removes the `/user` prefix from the URLs. For instance, the endpoint `/user/update` will now be changed to `/update-user`. - [x] change endpoints - [x] update tests - [x] update docs - [x] update examples --- <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-17 20:18: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#28851