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:
parent
c9836b032a
commit
00dffa95c4
2 changed files with 10 additions and 0 deletions
|
@ -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{}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue