[PR #3634] [CLOSED] feat(plugin): telegram login #4924

Closed
opened 2026-03-13 12:04:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3634
Author: @Re4GD
Created: 7/26/2025
Status: Closed

Base: canaryHead: feat/telegram-login-widget


📝 Commits (10+)

  • b367c1c docs: add telegram to sidebar
  • fd2882a docs: add initial documentation
  • 64401ea feat: add telegram profile type
  • bb4268d feat: add initial server and client plugins
  • 55d3c27 feat: add test file
  • d8c6fff fix: wording
  • 20edc26 Merge branch 'better-auth:main' into feat/telegram-login-widget
  • a529c94 fix: id comes as number from telegram
  • b78ca87 feat: added signIn for widget callback
  • 144c243 chore: add todos

📊 Changes

8 files changed (+1042 additions, -1 deletions)

View changed files

📝 docs/components/sidebar-content.tsx (+25 -1)
docs/content/docs/plugins/telegram.mdx (+264 -0)
packages/better-auth/src/plugins/telegram/client.ts (+15 -0)
packages/better-auth/src/plugins/telegram/error-codes.ts (+6 -0)
packages/better-auth/src/plugins/telegram/index.ts (+561 -0)
packages/better-auth/src/plugins/telegram/telegram.test.ts (+63 -0)
packages/better-auth/src/plugins/telegram/types.ts (+47 -0)
packages/better-auth/src/plugins/telegram/utils.ts (+61 -0)

📄 Description

Adds Telegram sign in via Telegram Login Widget. This PR does not include Telegram Mini Apps. Closes #3526

https://core.telegram.org/widgets/login


Summary by cubic

Adds Telegram Login Widget auth with 5‑minute max‑age and HMAC checks, remember‑me, and account link/unlink. Includes a client plugin, standardized endpoints, a redirectable callback with origin checks and new‑user/error redirects, typed errors/types, tests, and expanded docs with install/usage examples and a Telegram sidebar entry.

  • Bug Fixes
    • Accept string auth_date in callback and verifyMaxAge; match Telegram GET types.
    • Only redirect to newUserCallbackURL on first signup.
    • Rename endpoints to match URL convention.
    • Tweak callback/query param metadata for clarity.

Written for commit 16f6293061. Summary will update 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/3634 **Author:** [@Re4GD](https://github.com/Re4GD) **Created:** 7/26/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `feat/telegram-login-widget` --- ### 📝 Commits (10+) - [`b367c1c`](https://github.com/better-auth/better-auth/commit/b367c1caece902c02b7c3caf2585824f9587276a) docs: add telegram to sidebar - [`fd2882a`](https://github.com/better-auth/better-auth/commit/fd2882aa1a1774fb3355cc90587b0375556963d0) docs: add initial documentation - [`64401ea`](https://github.com/better-auth/better-auth/commit/64401eafd4552c7e5133d183e6b1aa175f6bce87) feat: add telegram profile type - [`bb4268d`](https://github.com/better-auth/better-auth/commit/bb4268d0ce35e80f5609d0e862f2131a61f9f5a3) feat: add initial server and client plugins - [`55d3c27`](https://github.com/better-auth/better-auth/commit/55d3c2707a0398d1c8a175d393ddf15995b4832d) feat: add test file - [`d8c6fff`](https://github.com/better-auth/better-auth/commit/d8c6fffb46630ecc65999161a52b78eec722f01a) fix: wording - [`20edc26`](https://github.com/better-auth/better-auth/commit/20edc268df72c82ae5ead19fc486324e697f22da) Merge branch 'better-auth:main' into feat/telegram-login-widget - [`a529c94`](https://github.com/better-auth/better-auth/commit/a529c94fe08fe05496399f61175cbeee6c08615e) fix: id comes as number from telegram - [`b78ca87`](https://github.com/better-auth/better-auth/commit/b78ca875b6ed3581725788f7a3d06025d8a6516c) feat: added signIn for widget callback - [`144c243`](https://github.com/better-auth/better-auth/commit/144c24375c24dff7c3ffc3e5a8befeafe02937ac) chore: add todos ### 📊 Changes **8 files changed** (+1042 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/sidebar-content.tsx` (+25 -1) ➕ `docs/content/docs/plugins/telegram.mdx` (+264 -0) ➕ `packages/better-auth/src/plugins/telegram/client.ts` (+15 -0) ➕ `packages/better-auth/src/plugins/telegram/error-codes.ts` (+6 -0) ➕ `packages/better-auth/src/plugins/telegram/index.ts` (+561 -0) ➕ `packages/better-auth/src/plugins/telegram/telegram.test.ts` (+63 -0) ➕ `packages/better-auth/src/plugins/telegram/types.ts` (+47 -0) ➕ `packages/better-auth/src/plugins/telegram/utils.ts` (+61 -0) </details> ### 📄 Description Adds Telegram sign in via Telegram Login Widget. This PR does not include Telegram Mini Apps. Closes #3526 https://core.telegram.org/widgets/login <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds Telegram Login Widget auth with 5‑minute max‑age and HMAC checks, remember‑me, and account link/unlink. Includes a client plugin, standardized endpoints, a redirectable callback with origin checks and new‑user/error redirects, typed errors/types, tests, and expanded docs with install/usage examples and a Telegram sidebar entry. - **Bug Fixes** - Accept string auth_date in callback and verifyMaxAge; match Telegram GET types. - Only redirect to newUserCallbackURL on first signup. - Rename endpoints to match URL convention. - Tweak callback/query param metadata for clarity. <sup>Written for commit 16f6293061927ddc3c14d63b85ba8ab14da2a52c. Summary will update 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-03-13 12:04:23 -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#4924