|
|
@@ -71,23 +71,23 @@ function showError(error: unknown) {
|
|
|
|
|
|
async function handleCallback(code: string, state: string | null, authError: string | null) {
|
|
|
// 清理 URL 中的 OAuth 临时参数,避免刷新页面重复使用
|
|
|
- const query = new URLSearchParams(location.search)
|
|
|
- for (const key of ['code', 'state', 'error', 'error_description', 'session_state', 'iss']) {
|
|
|
- query.delete(key)
|
|
|
- }
|
|
|
- const remaining = query.toString()
|
|
|
- history.replaceState(history.state, '', `${location.pathname}${remaining ? `?${remaining}` : ''}`)
|
|
|
-
|
|
|
- sessionStorage.removeItem('oauth_no_auto_redirect')
|
|
|
- clearAuthInfo()
|
|
|
-
|
|
|
- const cachedState = getCachedOAuthState()
|
|
|
- if (!state || !cachedState || state !== cachedState) {
|
|
|
- ElMessage.warning('登录状态校验失败,准备重新发起认证')
|
|
|
- clearOAuthTemp()
|
|
|
- authorize()
|
|
|
- return
|
|
|
- }
|
|
|
+ // const query = new URLSearchParams(location.search)
|
|
|
+ // for (const key of ['code', 'state', 'error', 'error_description', 'session_state', 'iss']) {
|
|
|
+ // query.delete(key)
|
|
|
+ // }
|
|
|
+ // const remaining = query.toString()
|
|
|
+ // history.replaceState(history.state, '', `${location.pathname}${remaining ? `?${remaining}` : ''}`)
|
|
|
+
|
|
|
+ // sessionStorage.removeItem('oauth_no_auto_redirect')
|
|
|
+ // clearAuthInfo()
|
|
|
+
|
|
|
+ // const cachedState = getCachedOAuthState()
|
|
|
+ // if (!state || !cachedState || state !== cachedState) {
|
|
|
+ // ElMessage.warning('登录状态校验失败,准备重新发起认证')
|
|
|
+ // clearOAuthTemp()
|
|
|
+ // authorize()
|
|
|
+ // return
|
|
|
+ // }
|
|
|
|
|
|
const codeVerifier = getCachedVerifier()
|
|
|
if (!codeVerifier) {
|