1
0
Fork 0
mirror of https://github.com/Luzifer/nginx-sso.git synced 2024-12-20 21:01: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 { if !ok {
return "", nil, errNoValidUserFound return "", nil, errNoValidUserFound
} }
// We had a cookie, lets renew it
if err := sess.Save(r, res); err != nil {
return "", nil, err
}
} }
groups := []string{} groups := []string{}

View file

@ -66,6 +66,11 @@ func (a authYubikey) DetectUser(res http.ResponseWriter, r *http.Request) (strin
return "", nil, errNoValidUserFound return "", nil, errNoValidUserFound
} }
// We had a cookie, lets renew it
if err := sess.Save(r, res); err != nil {
return "", nil, err
}
groups := []string{} groups := []string{}
for group, users := range a.Groups { for group, users := range a.Groups {
if str.StringInSlice(user, users) { if str.StringInSlice(user, users) {