Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: show error message when failed to request openid configuration (#14030)

boojackb73804476394
diff --git a/frontend/src/components/SSO/IdentityProviderCreateForm.vue b/frontend/src/components/SSO/IdentityProviderCreateForm.vue
index 63ba9c1687..a8643e71ef 100644
--- a/frontend/src/components/SSO/IdentityProviderCreateForm.vue
+++ b/frontend/src/components/SSO/IdentityProviderCreateForm.vue
@@ -967,7 +967,16 @@ const testConnection = async () => {
state.type === IdentityProviderType.OAUTH2 ||
state.type === IdentityProviderType.OIDC
) {
- openWindowForSSO(editedIdentityProvider.value);
+ try {
+ await openWindowForSSO(editedIdentityProvider.value);
+ } catch (error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: `Request error occurred`,
+ description: (error as any).message,
+ });
+ }
} else if (state.type === IdentityProviderType.LDAP) {
try {
await identityProviderClient.testIdentityProvider({
diff --git a/frontend/src/views/auth/Signin.vue b/frontend/src/views/auth/Signin.vue
index b269cb2b5b..922c4f9e24 100644
--- a/frontend/src/views/auth/Signin.vue
+++ b/frontend/src/views/auth/Signin.vue
@@ -182,6 +182,7 @@ import BytebaseLogo from "@/components/BytebaseLogo.vue";
import PasswordSigninForm from "@/components/PasswordSigninForm.vue";
import { AUTH_SIGNUP_MODULE } from "@/router/auth";
import {
+ pushNotification,
useActuatorV1Store,
useAuthStore,
useIdentityProviderStore,
@@ -283,10 +284,19 @@ const trySignin = async (idpName: string) => {
const trySigninWithIdentityProvider = async (
identityProvider: IdentityProvider
) => {
- await openWindowForSSO(
- identityProvider,
- false /* !popup */,
- route.query.redirect as string
- );
+ try {
+ await openWindowForSSO(
+ identityProvider,
+ false /* !popup */,
+ route.query.redirect as string
+ );
+ } catch (error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: `Request error occurred`,
+ description: (error as any).message,
+ });
+ }
};
</script>