diff --git a/auth_simple.go b/auth_simple.go index 1f497ef..297c67c 100644 --- a/auth_simple.go +++ b/auth_simple.go @@ -82,6 +82,11 @@ func (a authSimple) DetectUser(res http.ResponseWriter, r *http.Request) (string if !ok { return "", nil, errNoValidUserFound } + + // We had a cookie, lets renew it + if err := sess.Save(r, res); err != nil { + return "", nil, err + } } groups := []string{} diff --git a/auth_yubikey.go b/auth_yubikey.go index 2e0057e..5ae613b 100644 --- a/auth_yubikey.go +++ b/auth_yubikey.go @@ -66,6 +66,11 @@ func (a authYubikey) DetectUser(res http.ResponseWriter, r *http.Request) (strin return "", nil, errNoValidUserFound } + // We had a cookie, lets renew it + if err := sess.Save(r, res); err != nil { + return "", nil, err + } + groups := []string{} for group, users := range a.Groups { if str.StringInSlice(user, users) {