[PR #2113] [MERGED] Feat/add custom issuer totp #4159

Closed
opened 2026-03-13 11:35:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2113
Author: @Siumauricio
Created: 4/4/2025
Status: Merged
Merged: 4/11/2025
Merged by: @Bekacru

Base: mainHead: feat/add-custom-issuer-totp


📝 Commits (5)

  • 4799582 feat(two-factor): add optional issuer parameter for TOTP URI generation
  • 2b38c0c feat(two-factor): enhance issuer parameter handling for TOTP URI generation
  • 3768cf5 feat(two-factor): add tests for custom issuer handling and fallback to appName in TOTP URI generation
  • db799ce docs(two-factor): improve formatting and spacing in 2FA documentation for better readability
  • f6787aa docs(two-factor): refine code formatting and spacing in 2FA documentation for improved clarity

📊 Changes

3 files changed (+41 additions, -5 deletions)

View changed files

📝 docs/content/docs/plugins/2fa.mdx (+4 -3)
📝 packages/better-auth/src/plugins/two-factor/index.ts (+7 -2)
📝 packages/better-auth/src/plugins/two-factor/two-factor.test.ts (+30 -0)

📄 Description

This PR, add a custom issuer for 2fa, in dokploy we want to have a custom issuer as the user can have multiple instances, and sometimes it is difficult to know which issuer is related to a specific website as we use a hardcoded Dokploy issuer https://github.com/Dokploy/dokploy/blob/canary/packages/server/src/lib/auth.ts#L24.

So this PR, accept the issuer as a optional field when trying to enable the 2fa with the password and issuer as optional

Issue: https://github.com/Dokploy/dokploy/issues/1593


🔄 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/2113 **Author:** [@Siumauricio](https://github.com/Siumauricio) **Created:** 4/4/2025 **Status:** ✅ Merged **Merged:** 4/11/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feat/add-custom-issuer-totp` --- ### 📝 Commits (5) - [`4799582`](https://github.com/better-auth/better-auth/commit/4799582e9575995b5eb24044b9247aaf6e75653c) feat(two-factor): add optional issuer parameter for TOTP URI generation - [`2b38c0c`](https://github.com/better-auth/better-auth/commit/2b38c0c9b2b45e94946c7da4cfcafdf930eaa03b) feat(two-factor): enhance issuer parameter handling for TOTP URI generation - [`3768cf5`](https://github.com/better-auth/better-auth/commit/3768cf5d09b9920705062d6f4539fe3f27b503a5) feat(two-factor): add tests for custom issuer handling and fallback to appName in TOTP URI generation - [`db799ce`](https://github.com/better-auth/better-auth/commit/db799ce0465b2c5ae781d91909eecd24fcb8a106) docs(two-factor): improve formatting and spacing in 2FA documentation for better readability - [`f6787aa`](https://github.com/better-auth/better-auth/commit/f6787aaed6fef1c5a69d3f3e226487c01797c554) docs(two-factor): refine code formatting and spacing in 2FA documentation for improved clarity ### 📊 Changes **3 files changed** (+41 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/2fa.mdx` (+4 -3) 📝 `packages/better-auth/src/plugins/two-factor/index.ts` (+7 -2) 📝 `packages/better-auth/src/plugins/two-factor/two-factor.test.ts` (+30 -0) </details> ### 📄 Description This PR, add a custom issuer for 2fa, in dokploy we want to have a custom issuer as the user can have multiple instances, and sometimes it is difficult to know which issuer is related to a specific website as we use a hardcoded `Dokploy` issuer https://github.com/Dokploy/dokploy/blob/canary/packages/server/src/lib/auth.ts#L24. So this PR, accept the issuer as a optional field when trying to enable the 2fa with the password and issuer as optional Issue: https://github.com/Dokploy/dokploy/issues/1593 --- <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 11:35:00 -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#4159