Skip to content

Commit 61c0bfe

Browse files
committed
update credentials api to refactor
1 parent 3ea13ca commit 61c0bfe

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

packages/builder/src/components/providers/Github.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export default function Github({
7474
await fetchVerifiableCredential(
7575
process.env.REACT_APP_PASSPORT_IAM_URL || "",
7676
{
77-
type: CredentialProvider.Github,
77+
type: "VerifiableCredential",
78+
types: [CredentialProvider.Github],
79+
7880
version: "0.0.0",
7981
address: props.account || "",
8082
org,

packages/builder/src/components/providers/Twitter.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ export default function Twitter({
6666
await fetchVerifiableCredential(
6767
process.env.REACT_APP_PASSPORT_IAM_URL || "",
6868
{
69-
type: CredentialProvider.Twitter,
69+
type: "VerifiableCredential",
70+
types: [CredentialProvider.Twitter],
7071
version: "0.0.0",
7172
address: props.account || "",
7273
proofs: {

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class VerificationError extends Error {
5151
// Fetch a verifiableCredential
5252
export const fetchVerifiableCredential = async (
5353
iamUrl: string,
54-
payload: GHOrgRequestPayload,
54+
payload: any,
5555
signer: { signMessage: (message: string) => Promise<string> }
5656
): Promise<VerifiableCredentialRecord> => {
5757
// first pull a challenge that can be signed by the user
@@ -143,9 +143,12 @@ export function openOauthWindow(
143143
const channel = new BroadcastChannel(broadcastChannelName);
144144

145145
// timeout after 5 minutes
146-
const timeout = setTimeout(() => {
147-
reject(new VerificationError("Authorization timed out"));
148-
}, 1000 * 60 * 5);
146+
const timeout = setTimeout(
147+
() => {
148+
reject(new VerificationError("Authorization timed out"));
149+
},
150+
1000 * 60 * 5
151+
);
149152

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

0 commit comments

Comments
 (0)