func (t *TokenAuth) Refresh() error {
	if !t.IsAuthenticated() {
		return api.ErrorUnauthenticated
	}
	r, err := Refresh(*t.baseURL, t.headers)
	if err != nil {
		return err
	}
	t.token = r.Data.ClientToken.ClientToken
	t.headers.Set("X-Cerberus-Token", r.Data.ClientToken.ClientToken)
	return nil
}
Refresh attempts to refresh the token
package auth
import (
	"fmt"
	"net/http"
	"net/url"
	"os"
	"time"
	"github.com/Nike-Inc/cerberus-go-client/api"
	"github.com/Nike-Inc/cerberus-go-client/utils"
)
type TokenAuth struct {
	token   string
	headers http.Header
	baseURL *url.URL
}
func NewTokenAuth(cerberusURL, token string) (*TokenAuth, error) {
	if len(cerberusURL) == 0 {
		return nil, fmt.Errorf("Cerberus URL cannot be empty")
	}
	if len(token) == 0 {
		return nil, fmt.Errorf("Token cannot be empty")
	}
	parsedURL, err := utils.ValidateURL(cerberusURL)
	if err != nil {
		return nil, err
	}
	var headers = http.Header{}
	headers.Set("Content-Type", "application/json")
	headers.Set("Accept", "application/json")
	headers.Set("X-Cerberus-Token", token)
	return &TokenAuth{
		baseURL: parsedURL,
		headers: headers,
		token:   token,
	}, nil
}
func (t *TokenAuth) GetToken(f *os.File) (string, error) {
	if !t.IsAuthenticated() {
		return "", api.ErrorUnauthenticated
	}
	return t.token, nil
}
func (t *TokenAuth) IsAuthenticated() bool {
	return t.token != ""
}