Skip to content

fix(PRO-405): handle tgAuthResult in web and desktop#547

Open
mois-ilya wants to merge 4 commits intomainfrom
fix/PRO-405-telegram-trial-oauth
Open

fix(PRO-405): handle tgAuthResult in web and desktop#547
mois-ilya wants to merge 4 commits intomainfrom
fix/PRO-405-telegram-trial-oauth

Conversation

@mois-ilya
Copy link

@mois-ilya mois-ilya commented Feb 2, 2026

Problem

After Telegram OAuth redirect, popup window with tgAuthResult didn't send data back to opener via postMessage. This caused "Telegram connection failed" error. Also, trial activation endpoint was failing with "public_key required" due to missing authorization header.

Changes

OAuth postMessage fix

  • Add sendTgAuthResultToOpener() to @tonkeeper/core (shared between web and desktop)
  • Use the function in web/desktop entry points to send auth result via postMessage
  • Add comment explaining allowedHosts in vite.config.mts
  • Add comment explaining why withCredentials = false in desktop telegram-widget.js (Electron manages cookies separately)

Trial activation fix

  • Add authorization header to /api/v1/services/pro/trial endpoint
  • Pass auth token from subscriptionService.getToken() to TiersService.activateTrial()

CI fix

  • Migrate macOS runners from deprecated macos-13 to macos-15-intel (x64) and macos-latest (arm64/universal)

Status

  • ✅ Web: tested, OAuth works
  • ✅ Desktop: tested, OAuth works

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Successful WEB deployment 🚀🚀🚀

Well done!
Link to test environment:
https://99fdca61.tonkeeper-web.pages.dev

@mois-ilya mois-ilya force-pushed the fix/PRO-405-telegram-trial-oauth branch from 9af882a to fb375d6 Compare February 3, 2026 10:19
@mois-ilya mois-ilya marked this pull request as ready for review February 3, 2026 11:00
@Anonym-tsk
Copy link

lgtm

@nvasilchuk nvasilchuk self-requested a review February 10, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants