feat(auth): complete sso subsystem integration
This commit is contained in:
@@ -4,8 +4,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue'
|
||||
import { authApi } from '@/api/auth'
|
||||
import { getToken, removeToken } from '@/utils/auth'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { redirectToSSO } from '@/utils/sso'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
|
||||
@@ -18,11 +17,9 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
try {
|
||||
const { data } = await authApi.getUserInfo()
|
||||
authStore.setAuth(token, data)
|
||||
await authStore.refreshUser()
|
||||
} catch {
|
||||
authStore.clearAuth()
|
||||
removeToken()
|
||||
redirectToSSO()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user