Skip to content

Commit

Permalink
fix: IdentityManager
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat authored and mirceanis committed Sep 7, 2020
1 parent 226e490 commit 32a1c03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/daf-core/src/identity/identity-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface IAgentIdentityManager {
getIdentityProviders?: () => Promise<AbstractIdentityProvider[]>
getIdentities?: () => Promise<AbstractIdentity[]>
getIdentity?: (args: { did: string }) => Promise<AbstractIdentity>
createIdentity?: (args: { identityProviderType?: string; options?: any }) => Promise<AbstractIdentity>
createIdentity?: (args?: { identityProviderType?: string; options?: any }) => Promise<AbstractIdentity>
deleteIdentity?: (args: { identityProviderType: string; did: string }) => Promise<boolean>
}

Expand Down Expand Up @@ -65,11 +65,11 @@ export class IdentityManager implements IAgentPlugin {
}
}

async createIdentity(args: { identityProviderType?: string; options?: any }): Promise<AbstractIdentity> {
const identityProvider = args.identityProviderType
async createIdentity(args?: { identityProviderType?: string; options?: any }): Promise<AbstractIdentity> {
const identityProvider = args?.identityProviderType
? this.getIdentityProvider(args.identityProviderType)
: this.getDefaultIdentityProvider()
return identityProvider.createIdentity(args.options)
return identityProvider.createIdentity(args?.options)
}

async deleteIdentity(args: { identityProviderType: string; did: string }): Promise<boolean> {
Expand Down

0 comments on commit 32a1c03

Please sign in to comment.