jlelse
/
hugo-micropub
Archived
1
Fork 0

Undo changes to validation

This commit is contained in:
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")
}
// form the request to check the token
client := &http.Client{}
req, err := http.NewRequest("GET", indieAuthTokenUrl, nil)
if err != nil {
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("Authorization", token)
// send the request
res, err := http.Client{}.Do(req)
res, err := client.Do(req)
if err != nil {
return false, errors.New("error sending the request for checking token access")
}