Skip to content

Commit f8379f9

Browse files
committed
add help for not a vc error
1 parent 866df22 commit f8379f9

4 files changed

Lines changed: 81 additions & 3 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import styles from '../Help.module.css';
2+
export const NotVCHelp = () => {
3+
return <>
4+
<ul className={styles.list}>
5+
<li>Whatever you've provided as a Verifiable Credential wasn't understood by VerifierPlus</li>
6+
<li>You must provide a valid Verifiable Credential in JSON format (see below for an example).</li>
7+
<li>If you've pasted anything other than the JSON for a Verifiable Credential or a URL (link) that returns a Verifiable Credential, you'll get this error.</li>
8+
<li>If you've provided a URL, it may not return a Verifiable Credential, or may not be a valid URL.</li>
9+
<li>If you've not put anything at all into the text box, you'll also get this error.</li>
10+
</ul>
11+
12+
13+
<div className={styles.note}><img className={styles.infoIcon} src="./icons/info_24_lime.svg"></img>
14+
A simple example of a Verifiable Credential (and more specifically an Open Badge version 3 Verifiable Creential) that you can copy/paste into the text area if you like:
15+
16+
<pre className={styles.scrollableCode}>{`{
17+
"@context": [
18+
"https://www.w3.org/ns/credentials/v2",
19+
"https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
20+
],
21+
"validFrom": "2025-01-09T15:06:31Z",
22+
"id": "http://example.com/credentials/3527",
23+
"type": [
24+
"VerifiableCredential",
25+
"OpenBadgeCredential"
26+
],
27+
"issuer": {
28+
"id": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q",
29+
"type": [
30+
"Profile"
31+
],
32+
"name": "Example Corp"
33+
},
34+
"name": "Teamwork Badge",
35+
"credentialSubject": {
36+
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
37+
"type": [
38+
"AchievementSubject"
39+
],
40+
"achievement": {
41+
"id": "https://example.com/achievements/21st-century-skills/teamwork",
42+
"type": [
43+
"Achievement"
44+
],
45+
"criteria": {
46+
"narrative": "Team members are nominated for this badge by their peers and recognized upon review by Example Corp management."
47+
},
48+
"description": "This badge recognizes the development of the capacity to collaborate within a group environment.",
49+
"name": "Teamwork"
50+
}
51+
},
52+
"proof": {
53+
"type": "DataIntegrityProof",
54+
"created": "2025-11-10T14:49:26Z",
55+
"verificationMethod": "did:key:z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q#z6MknNQD1WHLGGraFi6zcbGevuAgkVfdyCdtZnQTGWVVvR5Q",
56+
"cryptosuite": "eddsa-rdfc-2022",
57+
"proofPurpose": "assertionMethod",
58+
"proofValue": "z3jqgQq2WpjsvHQp9XWxKcMvcehyTurrWawo33jvQk8CvbjQRvAgtsw9P2u2fXqY7iABSuBQdtt9UQyHsN82LRuq7"
59+
}
60+
}`}</pre>
61+
62+
A copy of that same Verifiable Credential is available at this URL:
63+
<div className={styles.scrollableLink}>
64+
<a href="https://digitalcredentials.github.io/vc-test-fixtures/verifiableCredentials/v2/dataIntegrityProof/didKey/legacyRegistry-noStatus-noExpiry-basicOBv3.json"><div className={styles.scrollableLink}>https://digitalcredentials.github.io/vc-test-fixtures/verifiableCredentials/v2/dataIntegrityProof/didKey/legacyRegistry-noStatus-noExpiry-basicOBv3.json</div></a>
65+
</div>
66+
You can also copy that URL and paste it into the text area. VerifierPlus will fetch the json from the URL and run verification.
67+
<div style={{paddingTop:'1em'}}>
68+
Finally, you can directly open that credential in VerifierPlus by clicking: <a target="_blank" style={{color:"black"}} href="https://verifierplus.org#verify?vc=https://digitalcredentials.github.io/vc-test-fixtures/verifiableCredentials/v2/dataIntegrityProof/didKey/legacyRegistry-noStatus-noExpiry-basicOBv3.json">here.</a>
69+
</div>
70+
</div>
71+
72+
73+
74+
</>
75+
}

app/components/Help/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ export * from './DragAndDropHelp/DragAndDropHelp'
1919
export * from './ScanQRHelp/ScanQRHelp'
2020
export * from './ChapiHelp/ChapiHelp'
2121
export * from './WarningMessageHelp/WarningMessageHelp'
22-
export * from './NotVerifiedMessageHelp/NotVerifiedMessageHelp'
22+
export * from './NotVerifiedMessageHelp/NotVerifiedMessageHelp'
23+
export * from './NotVCHelp/NotVCHelp'

app/index.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@
243243
padding-left: 8px;
244244
padding-block: 4px;
245245
display: flex;
246+
justify-content: center;
246247
border-radius: 5px;
247248
margin-top: 4px;
248249
max-width: 500px;

app/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { pollExchange } from '@/lib/exchanges';
2222
import packageJson from '../package.json';
2323
import * as polyfill from 'credential-handler-polyfill'
2424
import { ContextualHelp } from './components/ContextualHelp/ContextualHelp'
25-
import { ChapiHelp, DragAndDropHelp, LcwRequestHelp, PasteJsonUrlHelp, RegistryListHelp, ScanQRHelp } from './components/Help'
25+
import { ChapiHelp, DragAndDropHelp, LcwRequestHelp, NotVCHelp, PasteJsonUrlHelp, RegistryListHelp, ScanQRHelp } from './components/Help'
2626

2727
// NOTE: We currently only support one credential at a time. If a presentation with more than one credential
2828
// is dropped, pasted, or scanned we only look at the first one
@@ -485,8 +485,9 @@ export default function Home() {
485485
warning
486486
</span>
487487
<p className={styles.error}>
488-
The JSON is not a Verifiable Credential or an Open Badge 3.0
488+
Not a Verifiable Credential or an Open Badge 3.0
489489
</p>
490+
<span><ContextualHelp color='black' title="Not a Verifiable Credential"><NotVCHelp /></ContextualHelp> </span>
490491
</div>
491492
)}
492493

0 commit comments

Comments
 (0)