Telegram Auth with better-auth Plugin Isn’t Creating a Session

Setup:

Framework: Astro app, /api/auth route using better-auth v1.2.8

DB: SQLite via drizzleAdapter

Plugin: telegramAuth (BOT_TOKEN and BOT_USERNAME set)

Host: Hetzner VPS, DNS via Cloudflare, reverse-proxy with Caddy ([custom domain] localhost:4321)

Problem:

Telegram widget flow completes (200 from Telegram), but no better-auth session cookie is set.

Protected routes always return isAuthenticated: false, even though Google OAuth (same setup) works fine.

Has anyone attempted to build a telegram plugin that actually works?
Was this page helpful?