Move token logs to trace

pull/917/head
Simon Aronsson 3 years ago committed by GitHub
parent 6a7e5a959b
commit 028f19ac47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,8 +26,8 @@ func New(token string) *API {
func (api *API) RequireToken(fn http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if r.Header.Get("Authorization") != fmt.Sprintf("Bearer %s", api.Token) {
log.Errorf("Invalid token \"%s\"", r.Header.Get("Authorization"))
log.Debugf("Expected token to be \"%s\"", api.Token)
log.Tracef("Invalid token \"%s\"", r.Header.Get("Authorization"))
log.Tracef("Expected token to be \"%s\"", api.Token)
return
}
log.Debug("Valid token found.")

Loading…
Cancel
Save