mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 23:21:16 +08:00
fix: telegram support
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user