Skip to content

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

fix: vcs oauth event type (#4487)

boojack6a04f175d72b
diff --git a/frontend/src/views/OAuthCallback.vue b/frontend/src/views/OAuthCallback.vue
index 06aa9ca480..c60bf8ce7d 100644
--- a/frontend/src/views/OAuthCallback.vue
+++ b/frontend/src/views/OAuthCallback.vue
@@ -57,11 +57,17 @@ const closeWindow = () => {
})
);
} else {
- const eventType = sessionStorage.getItem(OAuthStateSessionKey) || "";
- if (
- eventType.startsWith("bb.oauth.signin") ||
- eventType.startsWith("bb.oauth.register-vcs") ||
- eventType.startsWith("bb.oauth.link-vcs-repository")
+ const eventName = sessionStorage.getItem(OAuthStateSessionKey) || "";
+ const eventType = eventName.slice(0, eventName.lastIndexOf("."));
+ if (eventName.startsWith("bb.oauth.signin")) {
+ window.opener.dispatchEvent(
+ new CustomEvent(eventName, {
+ detail: state.payload,
+ })
+ );
+ } else if (
+ eventName.startsWith("bb.oauth.register-vcs") ||
+ eventName.startsWith("bb.oauth.link-vcs-repository")
) {
window.opener.dispatchEvent(
new CustomEvent(eventType, {