This commit is contained in:
Andrew 2022-04-10 21:36:01 +07:00
parent b44fe71c28
commit a449bbb4c5
10 changed files with 1727 additions and 0 deletions

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Main page</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="stylesheet" href="/css/styles.css" />
</head>
<body>
<main>
<div id="telegram_passport_auth"></div>
</main>
</body>
<script src="/js/telegram-passport.js"></script>
<script>
Telegram.Passport.createAuthButton("telegram_passport_auth", {
bot_id: 2070888351,
scope: {
data: ["phone_number", "email"],
v: 1,
},
public_key:
"-----BEGIN PUBLIC KEY-----\n" +
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsL8dXeenYqVtFDt8+KhV\n" +
"fs6NVbA5mQsDOddGHArPsNmxjruyFWPPVc1SP2tQdqnLgw/y4O7L0ADBzYuTwxgo\n" +
"tp8G7+Z+Zs3KtPUZhtw98czl0c2IN8c8kZe1pj20FKdW7vEBTNKyzmBCJMvEO4ja\n" +
"8XfKokZH/JAsWOWGJsokHYQkACYgMCG7ZZ45JtgR5TDM8Ash9ThvPf5FTMPf+7Zq\n" +
"PPFpdsn91kOAKrm6QQDxCo8/CwbaY1/B2x3qEujO18805H+CvbVRJkuWMcHJ+oI8\n" +
"m8UnLD2rSgDhYMuU8E7xQRhWlM/YJIojCQufw9jV9ucXJfbLUjx+xtXdondFxod4\n" +
"OQIDAQAB\n" +
"-----END PUBLIC KEY-----",
nonce: "{{nonce}}",
callback_url: "http://localtest.me:9999/authCallback",
});
</script>
<script>
const debounce = (func, timeout = 300) => {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => {
func.apply(this, args);
}, timeout);
};
};
const load = async () => {};
document.addEventListener("DOMContentLoaded", init);
</script>
</html>