fix the SSO login issue of bug 14325 (#14326)

This commit is contained in:
younky-yang
2022-07-08 15:30:28 +08:00
committed by GitHub
parent 7ad51b2925
commit e0ad2bd69d

View File

@@ -44,18 +44,22 @@ export default defineComponent({
const { providers } = toRefs(props);
const ssoProviders = ref<{ name: string; link: string; icon: string }[]>([]);
watch(providers, () => {
ssoProviders.value = providers.value
.filter((provider: AuthProvider) => AUTH_SSO_DRIVERS.includes(provider.driver))
.map((provider: AuthProvider) => ({
name: formatTitle(provider.name),
link: `${getRootPath()}auth/login/${provider.name}?redirect=${window.location.href.replace(
location.search,
''
)}?continue`,
icon: provider.icon ?? 'account_circle',
}));
});
watch(
providers,
() => {
ssoProviders.value = providers.value
.filter((provider: AuthProvider) => AUTH_SSO_DRIVERS.includes(provider.driver))
.map((provider: AuthProvider) => ({
name: formatTitle(provider.name),
link: `${getRootPath()}auth/login/${provider.name}?redirect=${window.location.href.replace(
location.search,
''
)}?continue`,
icon: provider.icon ?? 'account_circle',
}));
},
{ immediate: true }
);
const errorFormatted = computed(() => {
const validReasons = ['SIGN_OUT', 'SESSION_EXPIRED'];