fix some other bugs of iam

This commit is contained in:
Montech
2026-10-11 16:01:15 +03:30
parent e4924a28f5
commit 025d223dac
227 changed files with 376 additions and 221 deletions
+10 -4
View File
@@ -7,13 +7,20 @@ import { useSessionStore } from '../../stores/session'
const router = useRouter()
const session = useSessionStore()
function backToCaller() {
sessionStorage.setItem('gb_iam_sso_skip', '1')
const saved = sessionStorage.getItem('gb_iam_return')
sessionStorage.removeItem('gb_iam_return')
const path = saved && saved.startsWith('/') && !saved.startsWith('//') ? saved : '/'
return router.replace(path)
}
onMounted(async () => {
const params = new URLSearchParams(window.location.search)
sessionStorage.removeItem('gb_iam_sso_checked')
if (params.get('error') || !params.get('code') || !params.get('state')) {
sessionStorage.setItem('gb_iam_sso_skip', '1')
await router.replace({ name: 'login' })
await backToCaller()
return
}
@@ -28,8 +35,7 @@ onMounted(async () => {
}
await router.replace({ name: 'home' })
} catch {
sessionStorage.setItem('gb_iam_sso_skip', '1')
await router.replace({ name: 'login' })
await backToCaller()
}
})
</script>