Skip to content

Commit

Permalink
Small code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Petya Koleva committed Jan 8, 2025
1 parent a204c1f commit 292d636
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion integration-tests/register_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func verificationRequest(httpClient *http.Client, userID, deviceName, accessID s

resp, err := makeRequest(
httpClient,
// options.apiURL+"/activate/initiate",
options.apiURL+"/verification",
"POST",
payload,
Expand All @@ -136,6 +135,7 @@ func verificationRequest(httpClient *http.Client, userID, deviceName, accessID s
}

var verificationResponse *verificationURLResponse

if err := json.Unmarshal(resp, &verificationResponse); err != nil {
return "", err
}
Expand Down Expand Up @@ -214,6 +214,7 @@ func clientSecretRequest(httpClient *http.Client, cs2url string) (*clientSecretR
}

var csResponse *clientSecretResponse

if err := json.Unmarshal(resp, &csResponse); err != nil {
return nil, err
}
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
mathRand "math/rand"
"net/http"
Expand Down Expand Up @@ -54,6 +55,10 @@ func getResponse(req *http.Request, httpClient *http.Client) (responseBody []byt
return []byte(redirectLocation.String()), resp.Cookies(), nil
}

if resp.StatusCode != http.StatusOK {
return nil, nil, fmt.Errorf("unsuccessful request (%s) to %s", strconv.Itoa(resp.StatusCode), req.URL.String())
}

responseBody, err = ioutil.ReadAll(resp.Body)
if err != nil {
return nil, nil, err
Expand Down
1 change: 0 additions & 1 deletion samples/go/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM ghcr.io/miracl/oidc-samples/proxy:latest as proxy


FROM golang:alpine as builder
WORKDIR /src
COPY . .
Expand Down

0 comments on commit 292d636

Please sign in to comment.