Fix checks for cached authorization

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

View File

@ -43,12 +43,16 @@ func (b *memoryBackend) cachedCheckAuthToken(conn redis.Conn, header string, r *
var err error
areweauth, err := getCachedValue(conn, key, r)
if areweauth {
authorized, err := getCachedValue(conn, key, r)
if err != nil {
log.Println(err)
}
if authorized {
return true
}
authorized := b.checkAuthToken(header, r)
authorized = b.checkAuthToken(header, r)
if authorized {
fmt.Printf("Token response: %#v\n", r)
setCachedTokenResponseValue(err, conn, key, r)