Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Nov 26, 2023
1 parent 52987fd commit f6e5687
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
6 changes: 3 additions & 3 deletions web/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit f6e5687

Please sign in to comment.