mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-03 18:40:46 +08:00
Revert "Add popup-based Google login function"
This reverts commit 1b39289dad.
This commit is contained in:
@@ -12,23 +12,7 @@ export async function googleGetIdToken() {
|
||||
window.google.accounts.id.initialize({
|
||||
client_id: GOOGLE_CLIENT_ID,
|
||||
callback: ({ credential }) => resolve(credential),
|
||||
use_fedcm: true
|
||||
})
|
||||
window.google.accounts.id.prompt()
|
||||
})
|
||||
}
|
||||
|
||||
export async function googleGetIdTokenWithPop() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!window.google || !GOOGLE_CLIENT_ID) {
|
||||
toast.error('Google 登录不可用, 请检查网络设置与VPN')
|
||||
reject()
|
||||
return
|
||||
}
|
||||
window.google.accounts.id.initialize({
|
||||
client_id: GOOGLE_CLIENT_ID,
|
||||
callback: ({ credential }) => resolve(credential),
|
||||
ux_mode: 'popup'
|
||||
use_fedcm: true
|
||||
})
|
||||
window.google.accounts.id.prompt()
|
||||
})
|
||||
@@ -69,15 +53,6 @@ export async function googleSignIn(redirect_success, redirect_not_approved) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function googleSignInWithPop(redirect_success, redirect_not_approved) {
|
||||
try {
|
||||
const token = await googleGetIdTokenWithPop()
|
||||
await googleAuthWithToken(token, redirect_success, redirect_not_approved)
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
import router from '../router'
|
||||
|
||||
export function loginWithGoogle() {
|
||||
@@ -89,15 +64,4 @@ export function loginWithGoogle() {
|
||||
router.push('/signup-reason?token=' + token)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function loginWithGoogleWithPop() {
|
||||
googleSignInWithPop(
|
||||
() => {
|
||||
router.push('/')
|
||||
},
|
||||
token => {
|
||||
router.push('/signup-reason?token=' + token)
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user