Skip to content

Commit 846af9c

Browse files
committed
read client id and redirect uri from server
1 parent faf77d3 commit 846af9c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/SettingsView/Components/License.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ import { storeToRefs } from 'pinia'
215215
216216
TimeAgo.addLocale(en)
217217
218+
let clientId = 'Ov23li5bsrEqMmqdT10i'
219+
let redirectUri = 'https://cloud.swingmx.com/auth/github/callback'
220+
218221
const error = ref<string | null>(null)
219222
const loading = ref(false)
220223
const settings = useSettingsStore()
@@ -301,6 +304,14 @@ async function getLicenseInfo(checkSponsor: boolean = false) {
301304
method: 'GET',
302305
})
303306
307+
if (response.data.redirect_url) {
308+
redirectUri = response.data.redirect_url
309+
}
310+
311+
if (response.data.client_id) {
312+
clientId = response.data.client_id
313+
}
314+
304315
if (response.status === 200) {
305316
settings.updateLicenseInfo(response.data)
306317
return
@@ -373,10 +384,7 @@ async function loginWithGitHub() {
373384
})
374385
}
375386
376-
const clientId = 'Ov23li5bsrEqMmqdT10i'
377387
const publicKey = settings.public_key
378-
// const redirectUri = 'http://localhost:1957/auth/github/callback'
379-
const redirectUri = 'https://cloud.swingmx.com/auth/github/callback'
380388
const githubUrl = `https://github.com/login/oauth/authorize`
381389
382390
const queryParams = new URLSearchParams({

0 commit comments

Comments
 (0)