1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-15 00:15:00 +02:00

Validate access_token when auto-refreshing cookie

This commit is contained in:
Mike Bland
2015-05-09 15:09:31 -04:00
parent 25372567ac
commit b6e07d51b2
2 changed files with 64 additions and 13 deletions

View File

@ -299,7 +299,10 @@ func (p *OauthProxy) ProcessCookie(rw http.ResponseWriter, req *http.Request) (e
} else if p.CookieRefresh != time.Duration(0) {
refresh_threshold := time.Now().Add(p.CookieRefresh)
if refresh_threshold.Unix() > timestamp.Unix() {
p.SetCookie(rw, req, value)
ok = p.ValidateToken(access_token)
if ok {
p.SetCookie(rw, req, value)
}
}
}
return