deploy
This commit is contained in:
@@ -7,6 +7,7 @@ import ProgressSpinner from 'primevue/progressspinner'
|
||||
const auth = useAuthStore()
|
||||
const loading = ref(false)
|
||||
const error = ref('')
|
||||
const botUserName = import.meta.env.VITE_TELEGRAM_BOT_USERNAME
|
||||
|
||||
// Telegram Login Widget callback — must be global
|
||||
;(window as any).onTelegramAuth = async (user: TelegramLoginData) => {
|
||||
@@ -21,6 +22,7 @@ const error = ref('')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
console.log(botUserName)
|
||||
// Check if running inside Telegram WebApp
|
||||
const webapp = window.Telegram?.WebApp
|
||||
if (webapp?.initData) {
|
||||
@@ -41,7 +43,8 @@ onMounted(async () => {
|
||||
if (container) {
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://telegram.org/js/telegram-widget.js?22'
|
||||
script.setAttribute('data-telegram-login', import.meta.env.VITE_TELEGRAM_BOT_USERNAME || '')
|
||||
console.log()
|
||||
script.setAttribute('data-telegram-login', botUserName || '')
|
||||
script.setAttribute('data-size', 'large')
|
||||
script.setAttribute('data-radius', '8')
|
||||
script.setAttribute('data-onauth', 'onTelegramAuth(user)')
|
||||
|
||||
Reference in New Issue
Block a user