From 2c1342633e0350968f18d5e8c33fc252ce59e3c4 Mon Sep 17 00:00:00 2001
From: Yordan Kinkov <yordan.kinkov@vereign.com>
Date: Fri, 22 Jul 2022 11:59:30 +0300
Subject: [PATCH] #4 modify OCM client

---
 ocm/client.go | 5 ++---
 ocm/types.go  | 6 +++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ocm/client.go b/ocm/client.go
index 862b1c3..3448cad 100644
--- a/ocm/client.go
+++ b/ocm/client.go
@@ -7,6 +7,7 @@ import (
 	"io"
 	"net/http"
 	"net/url"
+	"strings"
 )
 
 const (
@@ -43,9 +44,7 @@ func (c *Client) GetLoginProofInvitation(ctx context.Context, credTypes []string
 	}
 
 	v := url.Values{}
-	for _, t := range credTypes {
-		v.Add("type", t)
-	}
+	v.Add("type", strings.Join(credTypes, ","))
 	req.URL.RawQuery = v.Encode()
 
 	resp, err := c.httpClient.Do(req)
diff --git a/ocm/types.go b/ocm/types.go
index 3a002c4..44239da 100644
--- a/ocm/types.go
+++ b/ocm/types.go
@@ -18,7 +18,11 @@ type LoginProofResultResponse struct {
 }
 
 type LoginProofResultResponseData struct {
-	State     string                 `json:"state"`
+	State string       `json:"state"`
+	Data  []Credential `json:"data"`
+}
+
+type Credential struct {
 	SchemaID  string                 `json:"schemaId"`
 	CredDefID string                 `json:"credDefId"`
 	Claims    map[string]interface{} `json:"credentialSubject"`
-- 
GitLab