Skip to content

Commit

Permalink
fix: SDR only for sdr message type
Browse files Browse the repository at this point in the history
  • Loading branch information
simonas-notcat committed Apr 8, 2020
1 parent fc8db45 commit b77c5c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/daf-selective-disclosure/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Agent, Message, Presentation } from 'daf-core'
import { DataStore } from 'daf-data-store'
import { ActionTypes, ActionSignSdr, SelectiveDisclosureRequest } from './action-handler'
import { findCredentialsForSdr, validatePresentationAgainstSdr } from './helper'
import { MessageTypes } from './message-handler'

interface Context {
agent: Agent
Expand All @@ -15,7 +16,10 @@ const signSdrJwt = async (_: any, args: { data: SelectiveDisclosureRequest }, ct
} as ActionSignSdr)

const sdr = async (message: Message, { did }: { did: string }) => {
return findCredentialsForSdr(message.data, did)
if (message.type == MessageTypes.sdr) {
return findCredentialsForSdr(message.data, did)
}
return []
}

const validateAgainstSdr = async (
Expand Down

0 comments on commit b77c5c7

Please sign in to comment.