mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-02 10:00:54 +08:00
Expose Google client ID via API config and use dynamically
This commit is contained in:
@@ -17,7 +17,7 @@ export const API_PORT = 8081
|
||||
|
||||
// export const API_BASE_URL = API_PORT ? `${API_DOMAIN}:${API_PORT}` : API_DOMAIN
|
||||
export const API_BASE_URL = "";
|
||||
export const GOOGLE_CLIENT_ID = '777830451304-nt8afkkap18gui4f9entcha99unal744.apps.googleusercontent.com'
|
||||
export const config = { googleClientId: '' }
|
||||
export const toast = useToast()
|
||||
|
||||
initTheme()
|
||||
@@ -32,3 +32,10 @@ checkToken().then(valid => {
|
||||
clearToken()
|
||||
}
|
||||
})
|
||||
|
||||
fetch(`${API_BASE_URL}/api/config`).then(async res => {
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
config.googleClientId = data.googleClientId || ''
|
||||
}
|
||||
}).catch(() => {/* ignore */})
|
||||
|
||||
Reference in New Issue
Block a user