File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
common/src/services/passport
round-manager/src/features/round Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ export class PassportVerifierWithExpiration {
4040 // const { expirationDate, proof } = credential;
4141 const { proof } = credential ;
4242
43+ console . log ( "proof" , proof ) ;
44+
4345 // check that the credential is still valid (not expired)
4446 // if (new Date(expirationDate) > new Date()) {
4547 try {
@@ -51,6 +53,9 @@ export class PassportVerifierWithExpiration {
5153 )
5254 ) as { checks : string [ ] ; warnings : string [ ] ; errors : string [ ] } ;
5355
56+ console . log ( "verify" , verify ) ;
57+ console . log ( "verify.errors" , verify . errors . length === 0 ) ;
58+
5459 // did we get any errors when we attempted to verify?
5560 return verify . errors . length === 0 ;
5661 } catch ( e ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import { VerifiableCredential } from "@gitcoinco/passport-sdk-types";
55import { debounce } from "ts-debounce" ;
66import { PassportVerifierWithExpiration } from "./credentialVerifier" ;
77
8- const IAM_SERVER =
9- process . env . REACT_APP_PASSPORT_IAM_SERVER ||
10- "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC" ;
8+ const IAM_SERVER = [
9+ "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC" ,
10+ "did:ethr:0xd6f8d6ca86aa01e551a311d670a0d1bd8577e5fb" ,
11+ ] ;
1112
1213const verifier = new PassportVerifierWithExpiration ( ) ;
1314
@@ -24,7 +25,7 @@ export async function validateCredential(
2425 handle . toLowerCase ( ) ;
2526 const validCredential = await verifier . verifyCredential ( credential ) ;
2627
27- const validIssuer = IAM_SERVER === credential . issuer ;
28+ const validIssuer = IAM_SERVER . includes ( credential . issuer ) ;
2829
2930 return validCredentialProvider && validCredential && validIssuer ;
3031}
Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ import { convertApplications } from "../api/utils";
7474
7575type Status = "done" | "current" | "rejected" | "approved" | undefined ;
7676
77- export const IAM_SERVER =
78- "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC" ;
77+ export const IAM_SERVER = [
78+ "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC" ,
79+ "did:ethr:0xd6f8d6ca86aa01e551a311d670a0d1bd8577e5fb" ,
80+ ] ;
7981
8082const verifier = new PassportVerifierWithExpiration ( ) ;
8183
@@ -927,7 +929,9 @@ async function isVerified(
927929 application : GrantApplication | undefined
928930) {
929931 const vcHasValidProof = await verifier . verifyCredential ( verifiableCredential ) ;
930- const vcIssuedByValidIAMServer = verifiableCredential . issuer === IAM_SERVER ;
932+ const vcIssuedByValidIAMServer = IAM_SERVER . includes (
933+ verifiableCredential . issuer
934+ ) ;
931935 const providerMatchesProject = vcProviderMatchesProject (
932936 provider ,
933937 verifiableCredential ,
You can’t perform that action at this time.
0 commit comments