Undo changes to validation

kcoram/uplift
Jan-Lukas Else 2019-11-19 10:04:22 +01:00
parent 6d6d4baf82
commit 20bace6e9a
1 changed files with 2 additions and 1 deletions

View File

@ -34,6 +34,7 @@ func checkAccess(token string) (bool, error) {
return false, errors.New("token string is empty") return false, errors.New("token string is empty")
} }
// form the request to check the token // form the request to check the token
client := &http.Client{}
req, err := http.NewRequest("GET", indieAuthTokenUrl, nil) req, err := http.NewRequest("GET", indieAuthTokenUrl, nil)
if err != nil { if err != nil {
return false, errors.New("error making the request for checking token access") return false, errors.New("error making the request for checking token access")
@ -41,7 +42,7 @@ func checkAccess(token string) (bool, error) {
req.Header.Set("Accept", "application/json") req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", token) req.Header.Set("Authorization", token)
// send the request // send the request
res, err := http.Client{}.Do(req) res, err := client.Do(req)
if err != nil { if err != nil {
return false, errors.New("error sending the request for checking token access") return false, errors.New("error sending the request for checking token access")
} }