Skip to content

Commit

Permalink
Fixes Remember Me functionality
Browse files Browse the repository at this point in the history
- Adjust the remember me duration to 1 year
- Fixes #552
  • Loading branch information
james-d-elliott authored and clems4ever committed Jan 17, 2020
1 parent ece4423 commit e6ddedf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/handlers/handler_firstfactor.go
Expand Up @@ -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
Expand Down

0 comments on commit e6ddedf

Please sign in to comment.