mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-05-11 05:07:28 +08:00
fix: telegram support
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import CallbackPage from '~/components/CallbackPage.vue'
|
import CallbackPage from '~/components/CallbackPage.vue'
|
||||||
|
import { I } from '~/dist/_nuxt/F7ewH_Zb'
|
||||||
import { telegramExchange } from '~/utils/telegram'
|
import { telegramExchange } from '~/utils/telegram'
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -17,7 +18,8 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
let authData
|
let authData
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(decodeURIComponent(hash))
|
const decoded = atob(hash)
|
||||||
|
const parsed = JSON.parse(decoded)
|
||||||
authData = {
|
authData = {
|
||||||
id: String(parsed.id),
|
id: String(parsed.id),
|
||||||
firstName: parsed.first_name,
|
firstName: parsed.first_name,
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export function telegramAuthorize(inviteToken = '') {
|
|||||||
const url =
|
const url =
|
||||||
`https://oauth.telegram.org/auth` +
|
`https://oauth.telegram.org/auth` +
|
||||||
`?bot_id=${encodeURIComponent(TELEGRAM_BOT_ID)}` +
|
`?bot_id=${encodeURIComponent(TELEGRAM_BOT_ID)}` +
|
||||||
`&origin=${encodeURIComponent(WEBSITE_BASE_URL)}` +
|
`&origin=${encodeURIComponent(redirectUri)}` +
|
||||||
`&request_access=write` +
|
`&request_access=write`
|
||||||
`&redirect_uri=${encodeURIComponent(redirectUri)}`
|
// `&redirect_uri=${encodeURIComponent(redirectUri)}`
|
||||||
window.location.href = url
|
window.location.href = url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user