Skip to content

Commit e9621a7

Browse files
committed
added error message
1 parent 270411d commit e9621a7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

packages/builder/src/components/providers/identity/credentials.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ export const fetchVerifiableCredential = async (
9696
throw new VerificationError("No credential found");
9797
}
9898

99+
if (response.data[0].credential == null) {
100+
throw new VerificationError(
101+
"Error verifying ownership - ensure you are a public member of the org"
102+
);
103+
}
104+
99105
// return everything that was used to create the credential (along with the credential)
100106
return {
101107
signature,
@@ -157,9 +163,12 @@ export function openOauthWindow(
157163
const channel = new BroadcastChannel(broadcastChannelName);
158164

159165
// timeout after 5 minutes
160-
const timeout = setTimeout(() => {
161-
reject(new VerificationError("Authorization timed out"));
162-
}, 1000 * 60 * 5);
166+
const timeout = setTimeout(
167+
() => {
168+
reject(new VerificationError("Authorization timed out"));
169+
},
170+
1000 * 60 * 5
171+
);
163172

164173
channel.addEventListener("message", (event: any) => {
165174
const eventData = event.data as {

0 commit comments

Comments
 (0)