From f6e5687c249db45e80c73d1e9f7cf16df2b20302 Mon Sep 17 00:00:00 2001 From: Andrei Kurilov <18027129+akurilov@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:56:00 +0200 Subject: [PATCH] test --- web/index.html | 2 +- web/login.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/index.html b/web/index.html index d289a36..6b5b005 100644 --- a/web/index.html +++ b/web/index.html @@ -55,7 +55,7 @@ src="https://telegram.org/js/telegram-widget.js?22" data-telegram-login="AwakariBot" data-size="large" - data-onauth="handleAuthTelegram(creds)" + data-onauth="handleAuthTelegram(user)" data-request-access="write" data-radius="4" data-userpic="false"> diff --git a/web/login.js b/web/login.js index 44fe789..76e527b 100644 --- a/web/login.js +++ b/web/login.js @@ -12,9 +12,9 @@ function handleAuthGoogle(response) { window.location.assign("subs.html"); } -function handleAuthTelegram(creds) { - sessionStorage.setItem("userId", `tg://user?id=${creds.id}`); - const token = btoa(JSON.stringify(creds)); +function handleAuthTelegram(user) { + sessionStorage.setItem("userId", `tg://user?id=${user.id}`); + const token = btoa(JSON.stringify(user)); sessionStorage.setItem("authToken", token); }