From 6c236867ce33c0c16b102e02a08226d7eb9b2046 Mon Sep 17 00:00:00 2001 From: Greg Steuck Date: Wed, 28 Jul 2021 15:34:03 -0700 Subject: syz-manager: support oauth when calling syz-hub Permit empty hub_key to indicate oauth. --- dashboard/dashapi/dashapi.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dashboard/dashapi/dashapi.go') diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index 14fa44faa..a78e25073 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -53,12 +53,12 @@ func NewCustom(client, addr, key string, ctor RequestCtor, doer RequestDoer, return nil, err } wrappedDoer = func(req *http.Request) (*http.Response, error) { - if token, err := tokenCache.Get(time.Now()); err == nil { - req.Header.Add("Authorization", "Bearer "+token) - return doer(req) - } else { + token, err := tokenCache.Get(time.Now()) + if err != nil { return nil, err } + req.Header.Add("Authorization", token) + return doer(req) } } return &Dashboard{ -- cgit mrf-deployment