Skip to content

Commit

Permalink
Verification route fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lakshayman committed Feb 15, 2024
1 parent cfdfd71 commit 646fd7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions verify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,12 @@ func verify(profileURL string, chaincode string) (string, error) {
responseBody := bytes.NewBuffer(postBody)
resp, err := http.Post(profileURL, "application/json", responseBody)
if err != nil {
return "", err
return "BLOCKED", err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
return "BLOCKED", err
}
var re res
json.Unmarshal([]byte(body), &re)
Expand Down Expand Up @@ -286,6 +286,8 @@ func (d *deps) handler(request events.APIGatewayProxyRequest) (events.APIGateway

status, err := verify(profileURL, chaincode)
if err != nil {
logVerification(d.client, d.ctx, status, profileURL, userId)
setProfileStatus(d.client, d.ctx, userId, status)
return events.APIGatewayProxyResponse{}, err
}
logVerification(d.client, d.ctx, status, profileURL, userId)
Expand Down

0 comments on commit 646fd7b

Please sign in to comment.