Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Latest commit

 

History

History
52 lines (36 loc) · 1.46 KB

File metadata and controls

52 lines (36 loc) · 1.46 KB

@telegram-auth next-auth Example

Warning

Deprecated. This example wires NextAuth.js to the @telegram-auth/* packages, which are deprecated in favour of Telegram's OpenID Connect login.

Telegram publishes an OIDC discovery document, so the AuthDataValidator wiring this example demonstrates is no longer needed.

Wiring it up in the migration guide.

Kept for reference only; it is not maintained.

Get Started

  1. Clone the repository

    git clone https://github.com/manzoorwanijk/telegram-auth.git
    cd telegram-auth
  2. Install and build dependencies

    pnpm install
    pnpm kick-off
  3. Go to the next-auth example folder

    cd examples/next-auth
  4. Create a .env.local file by copying .example.env.local and update BOT_TOKEN and BOT_USERNAME with your bot's token and username that you got from @BotFather.

  5. Start the dev server

    pnpm run dev
  6. You may want to use ngrok to expose your local server to the internet.

    ngrok http 3000

    Copy the ngrok URL and update NEXTAUTH_URL in .env.local with it.

    Don't forget to send /setdomain command to @BotFather with the ngrok URL to fix the "Bot domain invalid" error.