From e9621a7b79a548f992dae3f50c809d89ce1681dc Mon Sep 17 00:00:00 2001 From: MasterHW <43460021+MasterHW@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:34:01 -0400 Subject: [PATCH 1/3] added error message --- .../components/providers/identity/credentials.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/providers/identity/credentials.ts b/packages/builder/src/components/providers/identity/credentials.ts index 7e7fab394b..ed1c54e6c4 100644 --- a/packages/builder/src/components/providers/identity/credentials.ts +++ b/packages/builder/src/components/providers/identity/credentials.ts @@ -96,6 +96,12 @@ export const fetchVerifiableCredential = async ( throw new VerificationError("No credential found"); } + if (response.data[0].credential == null) { + throw new VerificationError( + "Error verifying ownership - ensure you are a public member of the org" + ); + } + // return everything that was used to create the credential (along with the credential) return { signature, @@ -157,9 +163,12 @@ export function openOauthWindow( const channel = new BroadcastChannel(broadcastChannelName); // timeout after 5 minutes - const timeout = setTimeout(() => { - reject(new VerificationError("Authorization timed out")); - }, 1000 * 60 * 5); + const timeout = setTimeout( + () => { + reject(new VerificationError("Authorization timed out")); + }, + 1000 * 60 * 5 + ); channel.addEventListener("message", (event: any) => { const eventData = event.data as { From 60aeeafb24b963672f090f16ecb44eafac8d5e13 Mon Sep 17 00:00:00 2001 From: MasterHW <43460021+MasterHW@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:44:27 -0400 Subject: [PATCH 2/3] undo linter breaking change --- .../src/components/providers/identity/credentials.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/providers/identity/credentials.ts b/packages/builder/src/components/providers/identity/credentials.ts index ed1c54e6c4..cb172f7465 100644 --- a/packages/builder/src/components/providers/identity/credentials.ts +++ b/packages/builder/src/components/providers/identity/credentials.ts @@ -163,12 +163,9 @@ export function openOauthWindow( const channel = new BroadcastChannel(broadcastChannelName); // timeout after 5 minutes - const timeout = setTimeout( - () => { - reject(new VerificationError("Authorization timed out")); - }, - 1000 * 60 * 5 - ); + const timeout = setTimeout(() => { + reject(new VerificationError("Authorization timed out")); + }, 1000 * 60 * 5); channel.addEventListener("message", (event: any) => { const eventData = event.data as { From 4ae3803a4c0fd9ca392699ff669031e3fcf50253 Mon Sep 17 00:00:00 2001 From: MasterHW <43460021+MasterHW@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:54:09 -0400 Subject: [PATCH 3/3] better error handling --- .../builder/src/components/providers/identity/credentials.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/providers/identity/credentials.ts b/packages/builder/src/components/providers/identity/credentials.ts index cb172f7465..d34de64574 100644 --- a/packages/builder/src/components/providers/identity/credentials.ts +++ b/packages/builder/src/components/providers/identity/credentials.ts @@ -96,7 +96,7 @@ export const fetchVerifiableCredential = async ( throw new VerificationError("No credential found"); } - if (response.data[0].credential == null) { + if (response.data[0].credential.issuer.length === 0) { throw new VerificationError( "Error verifying ownership - ensure you are a public member of the org" );