From e6ddedf23de4aa6bb26dc9cf30ec86d6ab6b16b5 Mon Sep 17 00:00:00 2001 From: James Elliott Date: Fri, 17 Jan 2020 13:36:18 +1100 Subject: [PATCH] Fixes Remember Me functionality - Adjust the remember me duration to 1 year - Fixes #552 --- internal/handlers/handler_firstfactor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/handlers/handler_firstfactor.go b/internal/handlers/handler_firstfactor.go index b637b3bab..c6a0c3e1a 100644 --- a/internal/handlers/handler_firstfactor.go +++ b/internal/handlers/handler_firstfactor.go @@ -76,9 +76,9 @@ func FirstFactorPost(ctx *middlewares.AutheliaCtx) { return } - // and avoid the cookie to expire if "Remember me" was ticked. + // set the cookie to expire in 1 year if "Remember me" was ticked. if *bodyJSON.KeepMeLoggedIn { - err = ctx.Providers.SessionProvider.UpdateExpiration(ctx.RequestCtx, time.Duration(0)) + err = ctx.Providers.SessionProvider.UpdateExpiration(ctx.RequestCtx, time.Duration(31556952 * time.Second)) if err != nil { ctx.Error(fmt.Errorf("Unable to update expiration timer for user %s: %s", bodyJSON.Username, err), authenticationFailedMessage) return