Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-09 16:21:23 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-08-09 16:21:23 +0300
commit990eb1fc3f49f265d60172e85aaabe2deffe66c5 (patch)
treeabd42c80770649e9041f9147db2a12142300b412 /internal/auth/auth.go
parent27626cd8ddcd9cd8ff2046f306d88d4c78648eb1 (diff)
feat: capture errors when trying to fetch the access token
Diffstat (limited to 'internal/auth/auth.go')
-rw-r--r--internal/auth/auth.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/auth/auth.go b/internal/auth/auth.go
index daab3c8c..d4298702 100644
--- a/internal/auth/auth.go
+++ b/internal/auth/auth.go
@@ -510,6 +510,7 @@ func (a *Auth) checkAuthentication(w http.ResponseWriter, r *http.Request, domai
if err != nil {
logRequest(r).WithError(err).Error("Failed to retrieve info with token")
+ errortracking.Capture(err)
// call serve404 handler when auth fails
domain.ServeNotFoundAuthFailed(w, r)
return true
@@ -521,9 +522,10 @@ func (a *Auth) checkAuthentication(w http.ResponseWriter, r *http.Request, domai
return true
}
- if resp.StatusCode != 200 {
+ if resp.StatusCode != http.StatusOK {
// call serve404 handler when auth fails
logRequest(r).WithField("status", resp.Status).Error("Unexpected response fetching access token")
+ errortracking.Capture(fmt.Errorf("unexpected response fetching access token status: %d", resp.StatusCode))
domain.ServeNotFoundAuthFailed(w, r)
return true
}