Skip to content

Commit

Permalink
fix: Fix for update did [DEV-3494] (#472)
Browse files Browse the repository at this point in the history
Fix for update did
  • Loading branch information
Andrew Nikitin committed Jan 16, 2024
1 parent 9e28a8c commit 8a7682e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/controllers/did.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,15 @@ export class DIDController {
// handle request params
const { did, service, verificationMethod, authentication } = request.body as UpdateDidRequestBody;
// Get the didDocument from the request if it's placed there
let updatedDocument: DIDDocument | undefined = request.body.didDocument;
let updatedDocument: DIDDocument
// Get strategy e.g. postgres or local
const identityServiceStrategySetup = new IdentityServiceStrategySetup(response.locals.customer.customerId);

try {
if (!updatedDocument && did && (service || verificationMethod || authentication)) {
if (request.body.didDocument) {
// Just pass the didDocument from the user as is
updatedDocument = request.body.didDocument;
} else if (did && (service || verificationMethod || authentication)) {
// Resolve DID
const resolvedResult = await identityServiceStrategySetup.agent.resolveDid(did);
// Check output that DID is not deactivated or exist
Expand Down

0 comments on commit 8a7682e

Please sign in to comment.