in feed: add token for authorized request, plus better descriptions
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import * as R from "ramda";
|
||||
|
||||
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
||||
export const SERVICE_ID = "endorser.ch";
|
||||
|
||||
@@ -52,9 +54,6 @@ export interface RegisterVerifiableCredential {
|
||||
// See https://github.com/trentlarson/endorser-ch/blob/0cb626f803028e7d9c67f095858a9fc8542e3dbd/server/api/services/util.js#L6
|
||||
const HIDDEN_DID = "did:none:HIDDEN";
|
||||
|
||||
const UNKNOWN_ENTITY = "Someone Unknown";
|
||||
const UNKNOWN_VISIBLE = "Someone Unnamed";
|
||||
|
||||
export function isHiddenDid(did) {
|
||||
return did === HIDDEN_DID;
|
||||
}
|
||||
@@ -69,11 +68,11 @@ export function didInfo(did, identifiers, contacts) {
|
||||
} else {
|
||||
const contact = R.find((c) => c.did === did, contacts);
|
||||
if (contact) {
|
||||
return contact.name || "(no name)";
|
||||
return contact.name || "Someone Unnamed in Contacts";
|
||||
} else if (isHiddenDid(did)) {
|
||||
return UNKNOWN_ENTITY;
|
||||
return "Someone Not In Network";
|
||||
} else {
|
||||
return UNKNOWN_VISIBLE;
|
||||
return "Someone Not In Contacts";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user