Clean up the cached auth token code

This commit is contained in:
Peter Stuifzand 2018-09-15 16:11:11 +02:00
parent 994ab142d6
commit 6a26e9330e
Signed by: peter
GPG Key ID: 374322D56E5209E8

View File

@ -35,13 +35,13 @@ func (b *memoryBackend) cachedCheckAuthToken(conn redis.Conn, header string, r *
log.Println("Cached checking Auth Token")
tokens := authHeaderRegex.FindStringSubmatch(header)
if len(tokens) != 2 {
log.Println("No token found in the header")
return false
}
key := fmt.Sprintf("token:%s", tokens[1])
var err error
key := fmt.Sprintf("token:%s", tokens[1])
authorized, err := getCachedValue(conn, key, r)
if err != nil {