This commit is contained in:
sydneymorton 2020-11-17 13:45:49 -08:00
Родитель 855a7e3697
Коммит dbf02010e7
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
public protocol ResponseContaining {
var audienceUrl: String { get }
var audienceDid: String { get }

Просмотреть файл

@ -18,8 +18,13 @@ public struct PresentationResponseContainer: ResponseContaining {
public init(from presentationRequest: PresentationRequest, expiryInSeconds exp: Int = 3000) throws {
self.audienceUrl = presentationRequest.content.redirectURI ?? ""
self.audienceDid = presentationRequest.content.issuer ?? ""
guard let aud = presentationRequest.content.redirectURI,
let did = presentationRequest.content.issuer else {
throw PresentationResponseError.noAudienceSpecifiedInRequest
}
self.audienceDid = did
self.audienceUrl = aud
self.request = presentationRequest
self.expiryInSeconds = exp
}