fix: telegram support

This commit is contained in:
tim
2025-09-01 13:02:13 +08:00
parent e63d66806d
commit 575e90e558
2 changed files with 6 additions and 4 deletions

View File

@@ -4,6 +4,7 @@
<script setup>
import CallbackPage from '~/components/CallbackPage.vue'
import { I } from '~/dist/_nuxt/F7ewH_Zb'
import { telegramExchange } from '~/utils/telegram'
onMounted(async () => {
@@ -17,7 +18,8 @@ onMounted(async () => {
}
let authData
try {
const parsed = JSON.parse(decodeURIComponent(hash))
const decoded = atob(hash)
const parsed = JSON.parse(decoded)
authData = {
id: String(parsed.id),
firstName: parsed.first_name,

View File

@@ -14,9 +14,9 @@ export function telegramAuthorize(inviteToken = '') {
const url =
`https://oauth.telegram.org/auth` +
`?bot_id=${encodeURIComponent(TELEGRAM_BOT_ID)}` +
`&origin=${encodeURIComponent(WEBSITE_BASE_URL)}` +
`&request_access=write` +
`&redirect_uri=${encodeURIComponent(redirectUri)}`
`&origin=${encodeURIComponent(redirectUri)}` +
`&request_access=write`
// `&redirect_uri=${encodeURIComponent(redirectUri)}`
window.location.href = url
}