Commit 10aba630 authored by ale's avatar ale
Browse files

Add a grace time to the keystore TTL

Just to cover edge cases when sessions are about to expire.
parent c31919d0
...@@ -203,7 +203,9 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str ...@@ -203,7 +203,9 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str
} }
shard = userinfo.Shard shard = userinfo.Shard
} }
return true, h.keystore.Open(ctx, shard, username, password, h.authSessionLifetime) // Add a 'grace time' of 30 minutes to the key ttl.
ttl := h.authSessionLifetime + 1800
return true, h.keystore.Open(ctx, shard, username, password, ttl)
} }
// Callback called by the login handler whenever a user successfully // Callback called by the login handler whenever a user successfully
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment