1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 12:51:17 +00:00

Auto-Renew cookies in simple and yubikey authenticators

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-01-28 21:33:38 +01:00
parent c9836b032a
commit 00dffa95c4
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 10 additions and 0 deletions

View file

@ -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{}

View file

@ -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) {