Skip to content

Commit

Permalink
Fix for pin base proof.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjsvedin committed Oct 13, 2023
1 parent 83e0747 commit 3947ff2
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,5 @@ abstract class PinBasedProofEndpoints(
override suspend fun <SUBJECT : HasId<ID>, ID : Comparable<ID>> established(
handler: Authentication.SubjectHandler<SUBJECT, ID>,
item: SUBJECT
): Boolean {
val index = handler.subjectSerializer.descriptor.getElementIndex(info.property!!)
if(index == CompositeDecoder.UNKNOWN_NAME) return false
if(handler.subjectSerializer.descriptor.getElementDescriptor(index).isNullable) {
return Serialization.json.encodeToJsonElement(handler.subjectSerializer, item).jsonObject.get(info.property!!)?.let { it !is JsonNull } ?: false
} else {
return true
}
}
): Boolean = handler.get(item, info.property!!) != null
}

0 comments on commit 3947ff2

Please sign in to comment.