Cleanup message from auth.go

This commit is contained in:
Peter Stuifzand 2018-12-25 12:29:15 +01:00
parent a2f76c6071
commit 56d9981a4a
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -32,8 +32,6 @@ import (
var authHeaderRegex = regexp.MustCompile("^Bearer (.+)$") var authHeaderRegex = regexp.MustCompile("^Bearer (.+)$")
func (b *memoryBackend) cachedCheckAuthToken(conn redis.Conn, header string, r *auth.TokenResponse) bool { func (b *memoryBackend) cachedCheckAuthToken(conn redis.Conn, header string, r *auth.TokenResponse) bool {
log.Println("Cached checking Auth Token")
tokens := authHeaderRegex.FindStringSubmatch(header) tokens := authHeaderRegex.FindStringSubmatch(header)
if len(tokens) != 2 { if len(tokens) != 2 {
@ -54,8 +52,10 @@ func (b *memoryBackend) cachedCheckAuthToken(conn redis.Conn, header string, r *
authorized = b.checkAuthToken(header, r) authorized = b.checkAuthToken(header, r)
if authorized { if authorized {
fmt.Printf("Token response: %#v\n", r) err = setCachedTokenResponseValue(conn, key, r)
setCachedTokenResponseValue(conn, key, r) if err != nil {
log.Println(err)
}
return true return true
} }